:root {
  --v8-type-diary-bg: #2b1a20;
  --v8-type-diary-bg-hover: #352028;
  --v8-type-diary-border: #8c5a52;
  --v8-type-diary-accent: #d8b476;
  --v8-type-diary-ink: #f2e8dc;

  --v8-type-note-bg: #271f33;
  --v8-type-note-bg-hover: #312740;
  --v8-type-note-border: #a78bc4;
  --v8-type-note-accent: #a78bc4;
  --v8-type-note-ink: #eee7f5;

  --v8-type-quest-bg: #192731;
  --v8-type-quest-bg-hover: #203340;
  --v8-type-quest-border: #5b8fa3;
  --v8-type-quest-accent: #7ab5c9;
  --v8-type-quest-ink: #e4eff4;

  --v8-type-bg-bg: #1c2922;
  --v8-type-bg-bg-hover: #23342b;
  --v8-type-bg-border: #5c8a71;
  --v8-type-bg-accent: #8cc2a3;
  --v8-type-bg-ink: #e6f2eb;
}

.v77-state-bridge[hidden] {
  display: none !important;
}

.v77-unified-host,
.v77-journal,
.v77-background {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.v77-journal-grid:not(.v77-journal-list) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 15px;
  align-items: start;
  margin-top: 18px;
}

.v77-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 12px;
  align-items: flex-end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.v77-entry {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: linear-gradient(145deg, #2b2228, #16181e);
}

.v77-entry.is-search-target {
  box-shadow: 0 0 0 2px var(--gold, #d8b476), 0 10px 28px rgba(0, 0, 0, 0.65);
}

/* Distinct soft dark-fantasy colors for Diario (burgundy/gold), Quest (petrol blue) and Note (amethyst violet) */
.v77-entry[data-entry-type="diary"] {
  --v8-row-bg: var(--v8-type-diary-bg);
  --v8-row-hover: var(--v8-type-diary-bg-hover);
  --v8-row-border: var(--v8-type-diary-border);
  --v8-row-accent: var(--v8-type-diary-accent);
  --v8-row-ink: var(--v8-type-diary-ink);
  background: linear-gradient(145deg, var(--v8-type-diary-bg), #1d1317);
  border-color: var(--v8-type-diary-border);
  color: var(--v8-type-diary-ink);
}

.v77-entry[data-entry-type="diary"] .v77-summary:hover {
  background: var(--v8-type-diary-bg-hover);
}

.v77-entry[data-entry-type="diary"] .v77-emblem {
  border-color: var(--v8-type-diary-border);
  background: rgba(18, 11, 14, 0.72);
  color: var(--v8-type-diary-accent);
}

.v77-entry[data-entry-type="diary"] .v77-type-tag {
  color: var(--v8-type-diary-accent);
  border-color: rgba(216, 180, 118, 0.34);
  background: rgba(216, 180, 118, 0.08);
}

.v77-entry[data-entry-type="diary"] .v77-entry-title {
  color: var(--v8-type-diary-ink);
}

.v77-entry[data-entry-type="diary"] .v77-entry-date {
  border-color: rgba(140, 90, 82, 0.6);
  background: rgba(18, 11, 14, 0.76);
  color: #e8dacb;
}

.v77-entry[data-entry-type="diary"] .v77-entry-body {
  border-top-color: rgba(140, 90, 82, 0.55);
  background: rgba(20, 12, 16, 0.72);
}

.v77-entry[data-entry-type="quest"] {
  --v8-row-bg: var(--v8-type-quest-bg);
  --v8-row-hover: var(--v8-type-quest-bg-hover);
  --v8-row-border: var(--v8-type-quest-border);
  --v8-row-accent: var(--v8-type-quest-accent);
  --v8-row-ink: var(--v8-type-quest-ink);
  background: linear-gradient(145deg, var(--v8-type-quest-bg), #111b22);
  border-color: var(--v8-type-quest-border);
  color: var(--v8-type-quest-ink);
}

.v77-entry[data-entry-type="quest"] .v77-summary:hover {
  background: var(--v8-type-quest-bg-hover);
}

.v77-entry[data-entry-type="quest"] .v77-emblem {
  border-color: var(--v8-type-quest-border);
  background: rgba(12, 20, 26, 0.78);
  color: var(--v8-type-quest-accent);
}

.v77-entry[data-entry-type="quest"] .v77-type-tag {
  color: var(--v8-type-quest-accent);
  border-color: rgba(122, 181, 201, 0.36);
  background: rgba(122, 181, 201, 0.1);
}

.v77-entry[data-entry-type="quest"] .v77-entry-title {
  color: var(--v8-type-quest-ink);
}

.v77-entry[data-entry-type="quest"] .v77-entry-date {
  border-color: rgba(91, 143, 163, 0.55);
  background: rgba(12, 20, 26, 0.78);
  color: #d6e8ef;
}

.v77-entry[data-entry-type="quest"] .v77-entry-body {
  border-top-color: rgba(91, 143, 163, 0.52);
  background: rgba(12, 20, 26, 0.74);
}

.v77-entry[data-entry-type="note"] {
  --v8-row-bg: var(--v8-type-note-bg);
  --v8-row-hover: var(--v8-type-note-bg-hover);
  --v8-row-border: var(--v8-type-note-border);
  --v8-row-accent: var(--v8-type-note-accent);
  --v8-row-ink: var(--v8-type-note-ink);
  background: linear-gradient(145deg, var(--v8-type-note-bg), #1b1524);
  border-color: var(--v8-type-note-border);
  color: var(--v8-type-note-ink);
}

.v77-entry[data-entry-type="note"] .v77-summary {
  color: var(--v8-type-note-ink);
}

.v77-entry[data-entry-type="note"] .v77-summary:hover {
  background: var(--v8-type-note-bg-hover);
}

.v77-entry[data-entry-type="note"] .v77-emblem {
  border-color: var(--v8-type-note-border);
  background: rgba(19, 14, 27, 0.76);
  color: var(--v8-type-note-accent);
}

.v77-entry[data-entry-type="note"] .v77-type-tag {
  color: #cbb5e3;
  border-color: rgba(167, 139, 196, 0.4);
  background: rgba(167, 139, 196, 0.12);
  font-weight: 700;
}

.v77-entry[data-entry-type="note"] .v77-entry-title {
  color: var(--v8-type-note-ink);
}

.v77-entry[data-entry-type="note"] .v77-entry-date {
  border-color: rgba(167, 139, 196, 0.45);
  background: rgba(19, 14, 27, 0.78);
  color: #e2d8ee;
}

.v77-entry[data-entry-type="note"] .v77-entry-campaign {
  border-color: rgba(167, 139, 196, 0.42);
  background: rgba(19, 14, 27, 0.78);
  color: #e6ddf2;
}

.v77-entry[data-entry-type="note"] .v77-entry-campaign-icon {
  color: var(--v8-type-note-accent);
}

.v77-entry[data-entry-type="note"] .v77-open-hint {
  color: #cbb5e3;
}

.v77-entry[data-entry-type="note"] .v77-entry-body {
  border-top-color: rgba(167, 139, 196, 0.45);
  background: rgba(23, 18, 32, 0.86);
  color: var(--v8-type-note-ink);
}

.v77-entry[data-entry-type="note"] .v77-entry-body label,
.v77-entry[data-entry-type="note"] .v77-entry-body .v77-field-label {
  color: #cfc1df;
}

.v77-entry[data-entry-type="note"] .v77-entry-body input,
.v77-entry[data-entry-type="note"] .v77-entry-body select:not(.aly-rt-font-select),
.v77-entry[data-entry-type="note"] .v77-entry-body textarea,
.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-surface {
  background: #221b2e;
  color: var(--v8-type-note-ink);
  border-color: rgba(167, 139, 196, 0.42);
}

.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-font-select {
  background: #221b2e;
  color: var(--v8-type-note-ink);
  border-color: rgba(167, 139, 196, 0.48);
}

.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-toolbar {
  background: #1b1525;
  border-color: rgba(167, 139, 196, 0.42);
}

.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-btn {
  background: #271f33;
  color: var(--v8-type-note-ink);
  border-color: rgba(167, 139, 196, 0.36);
}

.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-btn:hover,
.v77-entry[data-entry-type="note"] .v77-entry-body .aly-rt-btn.is-active {
  background: #362b47;
  border-color: var(--v8-type-note-accent);
  color: #f6f1fb;
}

.v77-entry[data-entry-type="note"] .v77-entry-body button:not(.aly-rt-btn):not(.ui-btn-danger) {
  background: #2c233a;
  color: var(--v8-type-note-ink);
  border-color: rgba(167, 139, 196, 0.5);
}

.v77-entry[data-entry-type="note"] .v77-entry-body button:not(.aly-rt-btn):not(.ui-btn-danger):hover {
  background: #3a2e4d;
  border-color: #c5ace0;
  color: #ffffff;
}

/* Distinct soft dark-fantasy color for Background (muted forest / sage green) */
.v77-entry[data-entry-type="background"] {
  --v8-row-bg: var(--v8-type-bg-bg);
  --v8-row-hover: var(--v8-type-bg-bg-hover);
  --v8-row-border: var(--v8-type-bg-border);
  --v8-row-accent: var(--v8-type-bg-accent);
  --v8-row-ink: var(--v8-type-bg-ink);
  background: linear-gradient(145deg, var(--v8-type-bg-bg), #131d18);
  border-color: var(--v8-type-bg-border);
  color: var(--v8-type-bg-ink);
}

.v77-entry[data-entry-type="background"] .v77-summary:hover {
  background: var(--v8-type-bg-bg-hover);
}

.v77-entry[data-entry-type="background"] .v77-emblem {
  border-color: var(--v8-type-bg-border);
  background: rgba(13, 22, 18, 0.78);
  color: var(--v8-type-bg-accent);
}

.v77-entry[data-entry-type="background"] .v77-type-tag {
  color: var(--v8-type-bg-accent);
  border-color: rgba(140, 194, 163, 0.38);
  background: rgba(140, 194, 163, 0.11);
}

.v77-entry[data-entry-type="background"] .v77-entry-title {
  color: var(--v8-type-bg-ink);
}

.v77-entry[data-entry-type="background"] .v77-entry-date {
  border-color: rgba(92, 138, 113, 0.56);
  background: rgba(13, 22, 18, 0.78);
  color: #d7eae0;
}

.v77-entry[data-entry-type="background"] .v77-bg-img-badge {
  border-color: rgba(140, 194, 163, 0.42);
  background: rgba(13, 22, 18, 0.72);
  color: #cfe6d8;
}

.v77-entry[data-entry-type="background"] .v77-entry-body {
  border-top-color: rgba(92, 138, 113, 0.52);
  background: rgba(14, 23, 19, 0.78);
}

/* Distinct dark-fantasy color for Background generated images (antique bronze / warm amber) */
.v77-entry[data-entry-type="background"][data-bg-kind="image"] {
  --v8-row-bg: #271e15;
  --v8-row-hover: #35281c;
  --v8-row-border: #9a7846;
  --v8-row-accent: #e5be76;
  --v8-row-ink: #f6ead4;
  background: linear-gradient(145deg, #271e15, #17120d);
  border-color: #9a7846;
  color: #f6ead4;
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-summary:hover {
  background: #35281c;
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-emblem {
  border-color: #a6824d;
  background: rgba(24, 18, 12, 0.84);
  color: #e5be76;
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-type-tag {
  color: #e5be76;
  border-color: rgba(229, 190, 118, 0.42);
  background: rgba(229, 190, 118, 0.13);
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-entry-title {
  color: #f6ead4;
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-entry-date {
  border-color: rgba(154, 120, 70, 0.58);
  background: rgba(24, 18, 12, 0.82);
  color: #eddab8;
}

.v77-entry[data-entry-type="background"][data-bg-kind="image"] .v77-entry-body {
  border-top-color: rgba(154, 120, 70, 0.52);
  background: rgba(22, 17, 12, 0.8);
}

.v77-entry[hidden],
.v77-empty-filter[hidden] {
  display: none !important;
}

.v77-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 22px 16px 17px;
  cursor: pointer;
  list-style: none;
  color: var(--ink, #ede9e2);
}

.v77-summary::-webkit-details-marker {
  display: none;
}

.v77-summary:hover {
  background: #8d5b4522;
}

.v77-emblem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  border: 1px solid #aa8558;
  border-radius: 18px;
  overflow: hidden;
  box-sizing: border-box;
  color: var(--gold, #d8b476);
  background: radial-gradient(ellipse at 30% 20%, #7b533e55, #201b25);
}

.v77-emblem svg {
  width: 55px;
  height: 55px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-emblem-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

.v77-emblem-thumb[hidden] {
  display: none !important;
}

.v77-emblem.has-thumb {
  padding: 0;
}

.v77-emblem.has-thumb > svg {
  display: none;
}

.v77-caption {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.v77-type-tag {
  font-size: 11px;
  color: var(--muted, #b6b0a6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.v77-entry-title {
  font: 20px Georgia, serif;
  color: var(--gold, #d8b476);
  overflow-wrap: anywhere;
}

.v77-entry-date {
  border: 1px solid #7c674a;
  background: #101115;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 14px;
}

.v77-entry-campaign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-self: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #6b5842;
  background: rgba(16, 15, 20, 0.78);
  color: #dec9a4;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.v77-entry-campaign[hidden] {
  display: none !important;
}

.v77-entry-campaign-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  color: var(--gold, #d8b476);
  flex-shrink: 0;
}

.v77-entry-campaign-icon svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-quest-date-line {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.v77-quest-date-line + .v77-quest-date-line {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid #3c3329;
}

.v77-quest-date-line.is-tbd {
  color: var(--muted, #b6b0a6);
  font-style: italic;
}

.v77-open-hint {
  font-size: 11px;
  color: var(--muted, #b6b0a6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.v77-open {
  grid-column: 1 / -1;
}

.v77-open .v77-summary {
  flex-direction: row;
  text-align: left;
  padding: 15px 18px;
}

.v77-open .v77-emblem {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
}

.v77-open .v77-emblem svg {
  width: 38px;
  height: 38px;
}

.v77-open .v77-caption {
  max-width: 650px;
}

.v77-open .v77-entry-date {
  align-self: flex-start;
  min-width: 170px;
}

.v77-open .v77-entry-campaign {
  align-self: flex-start;
}

.v77-open .v77-open-hint {
  margin-left: auto;
}

.v77-entry-body {
  padding: 22px;
  border-top: 1px solid #6b5741;
  background: #15151b55;
}

.v77-entry-body > label,
.v77-quest-dates-rows > .v77-quest-date-row {
  font-size: 16px;
  margin-bottom: 16px;
}

.v77-quest-dates-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.v77-quest-dates-rows > .v77-quest-date-row {
  display: block;
  margin-bottom: 0;
}

.v77-quest-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.v77-enddate-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #6f6250;
  color: var(--gold, #d8b476);
  background: #141318;
}

.v77-enddate-status.is-pending {
  color: var(--muted, #b6b0a6);
  font-style: italic;
}

.v77-enddate-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v77-enddate-controls input {
  flex: 1;
}

.v77-clear-date {
  font-size: 12px;
  padding: 7px 10px;
  white-space: nowrap;
}

.v77-entry-body textarea {
  font: 18px/1.85 system-ui, sans-serif;
  min-height: 400px;
  padding: 18px;
}

.v77-entry-body textarea.v77-loot {
  min-height: 180px;
}

.v77-entry-body input,
.v77-entry-body select:not(.aly-rt-font-select) {
  font-size: 17px;
  padding: 11px;
}

.v77-type-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 1 178px;
  width: 178px;
  min-width: 150px;
  max-width: 190px;
  margin: 0;
  color: var(--muted, #b6b0a6);
  font-size: 13px;
  line-height: 1.25;
  box-sizing: border-box;
}

.v77-add {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.v77-add svg,
.v77-edit-skills svg {
  width: 19px;
  height: 19px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-skills-panel.magic-summary {
  display: block !important;
  min-width: 0;
  border-color: var(--border, #79694e);
}

.v77-skills-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.v77-skills-head h3 {
  margin-bottom: 0;
}

.v77-edit-skills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v77-table-scroll {
  overflow-x: auto;
  margin-top: 15px;
}

.v77-skills-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.v77-skills-table thead th {
  font-size: 12px;
  color: var(--gold, #d8b476);
  padding: 10px 8px;
  border-bottom: 1px solid #8b7052;
}

.v77-skills-table tbody th,
.v77-skills-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #473d35;
  font-size: 14px;
}

.v77-skills-table tbody th {
  font-weight: 500;
  min-width: 150px;
}

.v77-skills-table tbody th small {
  display: block;
  font-size: 12px;
}

.v77-skills-table td:nth-child(2) {
  color: var(--muted, #b6b0a6);
  font-size: 13px;
}

.v77-skills-table td:nth-child(3),
.v77-skills-table td:nth-child(4) {
  text-align: center;
}

.v77-skill-bonus,
.v77-skilled-bonus {
  display: inline-block;
  min-width: 43px;
  padding: 5px 7px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 18px;
  background: #101115;
  border: 1px solid #4d443b;
}

.v77-skilled-bonus {
  background: #45161d;
  border-color: #a02a35;
}

.v77-prof-mark {
  color: var(--gold, #d8b476);
  font-size: 19px;
}

.v77-tools {
  border-top: 1px solid #8b7052;
  margin-top: 20px;
  padding-top: 15px;
}

.v77-tools ul {
  padding-left: 19px;
}

.v77-tools li {
  margin: 7px 0;
}

.v77-skills-dialog {
  max-width: 850px;
}

.v77-skills-dialog fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.v77-skills-dialog form > button {
  margin-right: 8px;
}

.v77-skills-dialog input[type="checkbox"] {
  width: auto;
}

.v77-skills-dialog p[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .v77-journal-grid:not(.v77-journal-list) {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .v77-type-label {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 135px;
    max-width: 100%;
  }

  .v77-summary {
    padding: 16px 12px;
  }

  .v77-emblem {
    width: 78px;
    height: 78px;
  }

  .v77-emblem svg {
    width: 46px;
    height: 46px;
  }

  .v77-entry-title {
    font-size: 18px;
  }

  .v77-open .v77-summary {
    flex-wrap: wrap;
  }

  .v77-open .v77-caption {
    flex: 1;
    min-width: 130px;
  }

  .v77-open .v77-open-hint {
    width: 100%;
    text-align: right;
  }

  .v77-entry-body {
    padding: 14px;
  }

  .v77-entry-body textarea {
    font-size: 17px;
    line-height: 1.8;
    padding: 13px;
    min-height: 330px;
  }

  .v77-entry-body textarea.v77-loot {
    min-height: 170px;
  }

  .v77-skills-table tbody th,
  .v77-skills-table td {
    padding: 8px 5px;
  }

  .v77-skills-table td:nth-child(2) {
    font-size: 11px;
    min-width: 90px;
  }

  .v77-skills-head {
    align-items: start;
  }

  .v77-edit-skills {
    font-size: 12px;
  }

  .v77-skills-dialog fieldset {
    grid-template-columns: 1fr;
  }

  .v77-qc-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Diary Quick-Create Sections (Possedimenti & Anime intrecciate) */
.v77-field-block {
  margin-bottom: 16px;
}

.v77-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: var(--ink, #ede9e2);
}

.v77-qc-section {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #6b5842;
  border-radius: 9px;
  background: rgba(16, 15, 20, 0.62);
}

.v77-qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.v77-qc-header h4 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--gold, #d8b476);
}

.v77-qc-tool-note {
  margin: 0 0 8px;
}

.v77-qc-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v77-qc-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 11px;
  border: 1px solid #594b3b;
  border-radius: 7px;
  background: #17151c;
}

.v77-qc-chip.is-staged {
  border-style: dashed;
  border-color: #b79454;
  background: rgba(58, 46, 26, 0.35);
}

.v77-qc-chip.is-missing {
  border-color: #6b4e4e;
  opacity: 0.85;
}

.v77-qc-chip-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 200px;
}

.v77-qc-chip-info strong {
  color: #f3e4c8;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.v77-qc-chip-sub {
  font-size: 12px;
  color: var(--muted, #b6b0a6);
  overflow-wrap: anywhere;
}

.v77-qc-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v77-qc-chip-actions button {
  font-size: 12px;
  padding: 5px 9px;
}

.v77-qc-form {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #7d6748;
  border-radius: 8px;
  background: #141318;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v77-qc-form[hidden] {
  display: none !important;
}

.v77-qc-dup-box {
  padding: 10px 12px;
  border: 1px solid #c99748;
  border-radius: 7px;
  background: rgba(74, 52, 22, 0.45);
  font-size: 13px;
  color: #f6e7cb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v77-qc-dup-box[hidden] {
  display: none !important;
}

.v77-qc-dup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v77-qc-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #b74a4a;
  background: #471d22;
  color: #ffd7d7;
  font-size: 13px;
}

.v77-qc-error[hidden] {
  display: none !important;
}

.v77-diary-commit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #96774c;
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(64, 46, 26, 0.45), rgba(24, 20, 17, 0.8));
}

.v77-diary-commit-bar[hidden] {
  display: none !important;
}

.v77-diary-commit-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v77-entry-actions-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(121, 105, 78, 0.35);
}

/* Shared 4-Tab Bar (Memorie e Destino & Poteri e Talenti) */
.v77-area-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
}

.v77-area-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 11px 12px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid #594a3a;
  background: linear-gradient(150deg, #1d1a22, #141319);
  color: var(--ink, #ede9e2);
  cursor: pointer;
  box-sizing: border-box;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.v77-area-tab:hover {
  border-color: #9e8155;
  background: linear-gradient(150deg, #27222d, #191720);
}

.v77-area-tab.is-active {
  border-color: var(--gold, #d8b476);
  background: linear-gradient(150deg, #32281c, #1d1814);
  box-shadow: 0 0 0 1px rgba(216, 180, 118, 0.35);
}

.v77-area-tab-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #6b5842;
  background: rgba(16, 15, 20, 0.72);
  color: var(--gold, #d8b476);
  flex-shrink: 0;
}

.v77-area-tab-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Memorie e Destino: Background (emerald) */
.v77-area-tab[data-area-tab="background"] .v77-area-tab-ico {
  border-color: var(--v8-type-bg-border);
  color: var(--v8-type-bg-accent);
}

.v77-area-tab[data-area-tab="background"].is-active {
  border-color: var(--v8-type-bg-accent);
  background: linear-gradient(150deg, #1f3027, #141d18);
  box-shadow: 0 0 0 1px rgba(140, 194, 163, 0.34);
}

.v77-area-tab[data-area-tab="background"].is-active .v77-area-tab-text strong {
  color: #a9dec0;
}

/* Memorie e Destino: Obiettivi (slate-cobalt) */
.v77-area-tab[data-area-tab="obiettivi"] {
  border-color: rgba(91, 143, 163, 0.55);
}

.v77-area-tab[data-area-tab="obiettivi"]:hover {
  border-color: #7ab5c9;
  background: linear-gradient(150deg, #1b2833, #131b22);
}

.v77-area-tab[data-area-tab="obiettivi"] .v77-area-tab-ico {
  border-color: var(--v8-type-quest-border, #5b8fa3);
  color: var(--v8-type-quest-accent, #7ab5c9);
  background: rgba(18, 30, 38, 0.82);
}

.v77-area-tab[data-area-tab="obiettivi"].is-active {
  border-color: var(--v8-type-quest-accent, #7ab5c9);
  background: linear-gradient(150deg, #1c3140, #131f29);
  box-shadow: 0 0 0 1px rgba(122, 181, 201, 0.38);
}

.v77-area-tab[data-area-tab="obiettivi"].is-active .v77-area-tab-text strong {
  color: #9ad2e4;
}

/* Memorie e Destino: Anime (amethyst violet — distinct from Background, Cronache & Obiettivi) */
.v77-area-tab[data-area-tab="anime"] {
  border-color: rgba(146, 98, 174, 0.58);
}

.v77-area-tab[data-area-tab="anime"]:hover {
  border-color: #c795e0;
  background: linear-gradient(150deg, #281b33, #181220);
}

.v77-area-tab[data-area-tab="anime"] .v77-area-tab-ico {
  border-color: #9262ae;
  color: #cf9ee8;
  background: rgba(34, 21, 46, 0.84);
}

.v77-area-tab[data-area-tab="anime"].is-active {
  border-color: #cf9ee8;
  background: linear-gradient(150deg, #321f42, #1c1326);
  box-shadow: 0 0 0 1px rgba(207, 158, 232, 0.38);
}

.v77-area-tab[data-area-tab="anime"].is-active .v77-area-tab-text strong {
  color: #e2bef5;
}

/* Poteri e Talenti: Incantesimi (arcane indigo) */
.v77-area-tab[data-area-tab="incantesimi"] {
  border-color: rgba(114, 102, 186, 0.55);
}

.v77-area-tab[data-area-tab="incantesimi"]:hover {
  border-color: #a899f0;
  background: linear-gradient(150deg, #211d36, #141222);
}

.v77-area-tab[data-area-tab="incantesimi"] .v77-area-tab-ico {
  border-color: #7769ba;
  color: #b1a4f5;
  background: rgba(24, 21, 44, 0.84);
}

.v77-area-tab[data-area-tab="incantesimi"].is-active {
  border-color: #b1a4f5;
  background: linear-gradient(150deg, #292347, #17142b);
  box-shadow: 0 0 0 1px rgba(177, 164, 245, 0.36);
}

.v77-area-tab[data-area-tab="incantesimi"].is-active .v77-area-tab-text strong {
  color: #cfc6ff;
}

/* Poteri e Talenti: Capacità (forest jade) */
.v77-area-tab[data-area-tab="capacita"] {
  border-color: rgba(84, 145, 112, 0.55);
}

.v77-area-tab[data-area-tab="capacita"]:hover {
  border-color: #82cca2;
  background: linear-gradient(150deg, #1b2c23, #121c17);
}

.v77-area-tab[data-area-tab="capacita"] .v77-area-tab-ico {
  border-color: #549170;
  color: #88d1a8;
  background: rgba(18, 34, 26, 0.84);
}

.v77-area-tab[data-area-tab="capacita"].is-active {
  border-color: #88d1a8;
  background: linear-gradient(150deg, #1f362a, #13211a);
  box-shadow: 0 0 0 1px rgba(136, 209, 168, 0.36);
}

.v77-area-tab[data-area-tab="capacita"].is-active .v77-area-tab-text strong {
  color: #b2ebd0;
}

/* Poteri e Talenti: Azioni (crimson-copper) */
.v77-area-tab[data-area-tab="azioni"] {
  border-color: rgba(168, 86, 74, 0.58);
}

.v77-area-tab[data-area-tab="azioni"]:hover {
  border-color: #e08b79;
  background: linear-gradient(150deg, #301b1b, #1d1213);
}

.v77-area-tab[data-area-tab="azioni"] .v77-area-tab-ico {
  border-color: #a8564a;
  color: #e89684;
  background: rgba(42, 20, 20, 0.84);
}

.v77-area-tab[data-area-tab="azioni"].is-active {
  border-color: #e89684;
  background: linear-gradient(150deg, #3d2120, #231314);
  box-shadow: 0 0 0 1px rgba(232, 150, 132, 0.36);
}

.v77-area-tab[data-area-tab="azioni"].is-active .v77-area-tab-text strong {
  color: #f7b8a8;
}

/* Talenti e Oggetti: 2-row proportioned 12-col grid (Row 1: 4+4+4, Row 2: 7+5) */
.v77-area-tabs.v8-poteri-tabs {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="incantesimi"],
.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="capacita"],
.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="azioni"] {
  grid-column: span 4;
}

.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="caratteristiche"],
.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="dati-gioco"] {
  grid-column: span 7;
}

.v77-area-tabs.v8-poteri-tabs .v77-area-tab[data-area-tab="oggetti"] {
  grid-column: span 5;
}

.v77-area-tabs.v8-poteri-tabs .v77-area-tab-text strong {
  overflow: visible;
  text-overflow: clip;
}

/* Poteri e Talenti: Caratteristiche (antique gold) */
.v77-area-tab[data-area-tab="dati-gioco"],
.v77-area-tab[data-area-tab="caratteristiche"] {
  border-color: rgba(158, 129, 85, 0.55);
}

.v77-area-tab[data-area-tab="dati-gioco"].is-active,
.v77-area-tab[data-area-tab="caratteristiche"].is-active {
  border-color: var(--gold, #d8b476);
  background: linear-gradient(150deg, #32281c, #1d1814);
  box-shadow: 0 0 0 1px rgba(216, 180, 118, 0.36);
}

/* Poteri e Talenti: Oggetti (warm bronze-teal chest) */
.v77-area-tab[data-area-tab="oggetti"] {
  border-color: rgba(96, 146, 152, 0.58);
}

.v77-area-tab[data-area-tab="oggetti"]:hover {
  border-color: #82c8d0;
  background: linear-gradient(150deg, #1b2c30, #121c20);
}

.v77-area-tab[data-area-tab="oggetti"] .v77-area-tab-ico {
  border-color: #5b939b;
  color: #8fd2db;
  background: rgba(18, 34, 38, 0.84);
}

.v77-area-tab[data-area-tab="oggetti"].is-active {
  border-color: #8fd2db;
  background: linear-gradient(150deg, #1e353b, #122126);
  box-shadow: 0 0 0 1px rgba(143, 210, 219, 0.36);
}

.v77-area-tab[data-area-tab="oggetti"].is-active .v77-area-tab-text strong {
  color: #bae8ef;
}

.v77-area-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.v77-area-tab-text strong {
  font-family: Georgia, serif;
  font-size: 14.5px;
  color: var(--gold, #d8b476);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v77-area-tab-text small {
  font-size: 11px;
  color: var(--muted, #b6b0a6);
  line-height: 1.25;
  overflow-wrap: break-word;
}

.v77-area-tab-count {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #6b5842;
  background: rgba(16, 15, 20, 0.78);
  color: #e6d5b8;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.v77-area-tab[data-area-tab="obiettivi"] {
  position: relative;
}

.v77-area-tab[data-area-tab="obiettivi"]:hover,
.v77-area-tab[data-area-tab="obiettivi"]:focus-within {
  z-index: 12;
}

.v77-area-tab-count.v77-area-tab-count-alert {
  position: relative;
  min-width: 22px;
  text-align: center;
  box-sizing: border-box;
  opacity: 0.78;
}

.v77-area-tab-count.v77-area-tab-count-alert.is-pending {
  opacity: 1;
  border-color: #ffe382;
  background: linear-gradient(180deg, #f8d44c 0%, #dca11a 100%);
  color: #1c1304;
  box-shadow:
    0 0 0 1px rgba(248, 212, 76, 0.28),
    0 2px 8px rgba(220, 161, 26, 0.42);
}

.v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 4px);
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(248, 212, 76, 0.72);
  background: linear-gradient(160deg, #272016 0%, #15120d 100%);
  color: #fde9a2;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.58);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 25;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translate(-50%, 4px) rotate(45deg);
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(248, 212, 76, 0.72);
  border-bottom: 1px solid rgba(248, 212, 76, 0.72);
  background: #18140e;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 24;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.v77-area-tab[data-area-tab="obiettivi"]:hover .v77-area-tab-count-alert.is-pending[data-tooltip]::after,
.v77-area-tab[data-area-tab="obiettivi"]:focus-visible .v77-area-tab-count-alert.is-pending[data-tooltip]::after,
.v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.v77-area-tab[data-area-tab="obiettivi"]:hover .v77-area-tab-count-alert.is-pending[data-tooltip]::before,
.v77-area-tab[data-area-tab="obiettivi"]:focus-visible .v77-area-tab-count-alert.is-pending[data-tooltip]::before,
.v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) rotate(45deg);
}

.v77-anime-root {
  display: block;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1040px) {
  .v77-area-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .v77-area-tabs.v8-poteri-tabs {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
  }

  .v77-area-tab {
    padding: 10px 11px;
    gap: 9px;
  }

  .v77-area-tab-ico {
    width: 31px;
    height: 31px;
  }

  .v77-area-tab-ico svg {
    width: 17px;
    height: 17px;
  }

  .v77-area-tab-text strong {
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  .v77-area-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .v77-area-tabs.v8-poteri-tabs {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
  }

  .v77-area-tabs.v8-poteri-tabs .v77-area-tab {
    padding: 8px 4px;
    gap: 4px;
  }

  .v77-area-tabs.v8-poteri-tabs .v77-area-tab-text strong {
    font-size: 11.5px;
    white-space: nowrap;
  }

  .v77-area-tab {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 9px 7px;
    gap: 5px;
  }

  .v77-area-tab-text {
    align-items: center;
    width: 100%;
  }

  .v77-area-tab-text strong {
    font-size: 13px;
    max-width: 100%;
  }

  .v77-area-tab-text small {
    display: none;
  }

  .v77-area-tab-count {
    font-size: 10.5px;
    padding: 1px 6px;
  }

  .v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]::after {
    left: 0;
    transform: translate(-18%, 4px);
    white-space: normal;
    width: max-content;
    max-width: min(210px, 78vw);
    text-align: center;
  }

  .v77-area-tab[data-area-tab="obiettivi"]:hover .v77-area-tab-count-alert.is-pending[data-tooltip]::after,
  .v77-area-tab[data-area-tab="obiettivi"]:focus-visible .v77-area-tab-count-alert.is-pending[data-tooltip]::after,
  .v77-area-tab-count.v77-area-tab-count-alert.is-pending[data-tooltip]:hover::after {
    transform: translate(-18%, 0);
  }
}

/* Upgraded Diario Item Quick-Create Subform */
.v77-qc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  align-items: end;
}

.v77-qc-mini-lbl {
  display: block;
  font-size: 13px;
  color: var(--muted, #b6b0a6);
  margin-bottom: 5px;
}

.v77-qc-qty-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v77-qc-qty-row input {
  width: 74px;
  text-align: center;
  padding: 8px 6px !important;
  font-size: 15px !important;
}

.v77-qc-qty-row button {
  width: 34px;
  height: 36px;
  padding: 0;
  font-weight: 700;
}

.v77-qc-optional {
  border: 1px solid #594b3b;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(20, 18, 25, 0.65);
}

.v77-qc-optional > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--gold, #d8b476);
  font-weight: 600;
}

.v77-qc-opt-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Background Area inside Diario e Background */
.v77-bg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.v77-bg-search {
  flex: 1 1 220px;
  max-width: 360px;
}

.v77-bg-card:not([data-entry-type="background"]) {
  background: linear-gradient(145deg, #272230, #16151d);
  border-color: #7d684a;
}

.v77-bg-img-badge {
  display: inline-block;
  align-self: center;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #7d6748;
  background: rgba(16, 15, 20, 0.72);
  color: #dec9a4;
  font-size: 11px;
}

.v77-open .v77-bg-img-badge {
  align-self: flex-start;
}

.v77-bg-img-badge[hidden] {
  display: none !important;
}

.v77-bg-image-box {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #6b5842;
  border-radius: 9px;
  background: rgba(16, 15, 20, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v77-bg-image-box h4 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--gold, #d8b476);
}

.v77-bg-preview {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #6b5842;
  background: #0f0e13;
}

.v77-bg-card[data-bg-kind="image"] .v77-bg-preview {
  max-height: 440px;
}

.v77-bg-card[data-bg-kind="image"] .v77-bg-img-desc {
  min-height: 82px;
  resize: vertical;
}

.v77-bg-preview[hidden] {
  display: none !important;
}

.v77-bg-img-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.v77-bg-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid rgba(195, 158, 98, 0.54);
  border-radius: 8px;
  background: linear-gradient(155deg, #2d1b22, #1c1317);
  color: #f2e5ce;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0 !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.v77-bg-file-label:hover,
.v77-bg-file-label:focus-within {
  background: linear-gradient(155deg, #40242e, #281920);
  border-color: #e2c287;
  color: #fff5e0;
}

.v77-bg-file-label input[type="file"] {
  display: none;
}

@media print {
  .v77-journal-grid {
    display: block;
  }

  .v77-entry,
  .v77-entry[data-entry-type="diary"],
  .v77-entry[data-entry-type="quest"],
  .v77-entry[data-entry-type="note"],
  .v77-entry[data-entry-type="background"] {
    margin: 12px 0 !important;
    overflow: visible;
    background: white;
    color: black;
  }

  .v77-entry[data-entry-type="note"] .v77-summary,
  .v77-entry[data-entry-type="note"] .v77-entry-title,
  .v77-entry[data-entry-type="note"] .v77-entry-date,
  .v77-entry[data-entry-type="note"] .v77-type-tag,
  .v77-entry[data-entry-type="note"] .v77-entry-body,
  .v77-entry[data-entry-type="note"] .v77-entry-body label,
  .v77-entry[data-entry-type="note"] .v77-entry-body .v77-field-label {
    color: black;
    background: white;
  }

  .v77-emblem,
  .v77-open-hint,
  .v77-type-label,
  .v77-journal-count,
  .v77-edit-skills,
  .v77-clear-date,
  .v77-qc-form,
  .v77-diary-commit-bar {
    display: none !important;
  }

  .v77-entry-campaign {
    color: black;
    background: white;
    border-color: #999;
  }

  .v77-entry-body,
  .v77-entry[data-entry-type="note"] .v77-entry-body {
    background: white;
    color: black;
  }

  .v77-skills-table th,
  .v77-skills-table td {
    color: black !important;
  }

  .v77-skilled-bonus,
  .v77-skill-bonus {
    background: white;
    color: black;
  }
  .v77-card-status-bar,
  .v77-links-commit-bar {
    display: none !important;
  }
}

.v77-card-status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
  margin-bottom: 4px;
}

.v77-links-commit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212, 176, 114, 0.55);
  background: rgba(54, 24, 34, 0.65);
}

.v77-links-commit-bar[hidden] {
  display: none !important;
}

.v77-links-commit-info {
  font-size: 0.84rem;
  color: #f4dfc0;
}

.v77-links-commit-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v77-entry-actions-footer .ui-btn-danger {
  border-color: #c86472;
  background: linear-gradient(180deg, #5a1824, #3d0f18);
  color: #ffe0e4;
}

.v77-entry-actions-footer .ui-btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #74202f, #501520);
  border-color: #e68290;
}

.v77-entry-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.v77-entry-tags[hidden] {
  display: none !important;
}

.v77-entry-actions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(121, 105, 78, 0.35);
}

.v77-entry-footer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.v77-reset-filters-btn,
.v77-bg-reset-btn {
  align-self: flex-end;
  white-space: nowrap;
}

.v77-reset-filters-btn[hidden],
.v77-bg-reset-btn[hidden] {
  display: none !important;
}

.v77-bg-tag-select {
  width: auto !important;
  min-width: 170px;
  margin: 0 !important;
}

@media (max-width: 640px) {
  .v77-entry-actions-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .v77-entry-footer-tools {
    width: 100%;
  }

  .v77-entry-footer-tools > button,
  .v77-entry-actions-footer > .ui-btn-danger {
    flex: 1 1 auto;
  }

  .v77-bg-tag-select {
    width: 100% !important;
  }
}

/* =========================================================
   VERSIONE 8 — ELENCO A RIGA A TUTTA LARGHEZZA
   (Cronache: Diario, Note, Quest + Sezione Background)
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.v77-journal-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 16px;
  box-sizing: border-box;
}

.v77-journal-list .v77-entry {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-width: 1px;
  border-style: solid;
  border-left: 3px solid var(--v8-row-accent, var(--gold, #d8b476));
  border-radius: 9px;
  overflow: visible;
  overflow-x: clip;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.v77-journal-list .v77-fold {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.v77-journal-list .v77-entry.v77-open {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.36);
}

.v77-journal-list .v77-summary {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 38px;
  align-items: center;
  text-align: left;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 58px;
  box-sizing: border-box;
  gap: 6px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.v77-journal-list .v77-open .v77-summary {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 38px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 58px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px 8px 0 0;
  background: var(--v8-row-hover, rgba(255, 255, 255, 0.04));
}

.v77-journal-list .v77-summary:focus-visible {
  outline: 2px solid var(--v8-row-accent, var(--gold, #d8b476));
  outline-offset: -2px;
}

.v77-journal-list .v77-emblem,
.v77-journal-list .v77-open .v77-emblem {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 8px;
  border-width: 1px;
  border-style: solid;
}

.v77-journal-list .v77-emblem svg,
.v77-journal-list .v77-open .v77-emblem svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-journal-list .v77-caption,
.v77-journal-list .v77-open .v77-caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

.v77-journal-list .v77-entry-title {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.32;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}

.v77-journal-list .v77-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  max-width: 100%;
}

.v77-journal-list .v77-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  flex: 0 0 auto;
}

.v77-journal-list .v77-row-meta .v79-progress-badge {
  margin: 0;
  align-self: center;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  line-height: 1.35;
  max-width: 100%;
}

.v77-journal-list .v77-entry-campaign,
.v77-journal-list .v77-open .v77-entry-campaign {
  align-self: center;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.v77-journal-list .v77-bg-img-badge,
.v77-journal-list .v77-open .v77-bg-img-badge,
.v77-journal-list .v77-row-links-badge {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid rgba(216, 180, 118, 0.34);
  background: rgba(14, 13, 18, 0.65);
  color: #d8ccb8;
  font-size: 11px;
  line-height: 1.35;
}

.v77-journal-list .v77-row-links-badge[hidden] {
  display: none !important;
}

.v77-journal-list .v77-entry-date-group,
.v77-journal-list .v77-open .v77-entry-date-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  align-self: center;
  justify-self: end;
  min-width: 0;
}

.v77-row-unassigned-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px dashed rgba(216, 180, 118, 0.48);
  background: rgba(16, 14, 20, 0.72);
  color: var(--book-accent, #e2c693);
  flex: 0 0 auto;
  opacity: 0.92;
}

.v77-row-unassigned-ico[hidden] {
  display: none !important;
}

.v77-row-unassigned-ico svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-journal-list .v77-entry-date,
.v77-journal-list .v77-open .v77-entry-date {
  align-self: center;
  justify-self: end;
  min-width: 0;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.25;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.v77-journal-list .v77-entry-date.is-empty {
  opacity: 0.62;
  color: var(--muted, #b6b0a6);
  border-style: dashed;
}

.v77-journal-list .v77-open-hint,
.v77-journal-list .v77-open .v77-open-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 12, 16, 0.52);
  color: var(--v8-row-accent, var(--gold, #d8b476));
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
  flex: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.v77-journal-list .v77-open-hint svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-journal-list .v77-summary:hover .v77-open-hint,
.v77-journal-list .v77-summary:focus-visible .v77-open-hint {
  border-color: var(--v8-row-accent, var(--gold, #d8b476));
  background: rgba(12, 12, 16, 0.82);
  color: #ffffff;
}

.v77-journal-list .v77-open-hint::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(216, 180, 118, 0.45);
  background: #141218;
  color: #f4ebd8;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.48);
}

.v77-journal-list .v77-summary:hover .v77-open-hint::after,
.v77-journal-list .v77-summary:focus-visible .v77-open-hint::after {
  opacity: 1;
  visibility: visible;
}

/* Open card adaptation: fluid full-width container, zero horizontal overflow, natural page scroll */
.v77-journal-list .v77-entry-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 0 0 8px 8px;
  overflow: visible;
  overflow-x: clip;
  max-height: none;
  overscroll-behavior: auto;
}

.v77-journal-list .v77-entry-body > *,
.v77-journal-list .v77-entry-body label,
.v77-journal-list .v77-entry-body input,
.v77-journal-list .v77-entry-body select,
.v77-journal-list .v77-entry-body textarea,
.v77-journal-list .v77-entry-body .aly-rt-wrap,
.v77-journal-list .v77-entry-body .aly-rt-toolbar,
.v77-journal-list .v77-entry-body .aly-rt-surface,
.v77-journal-list .v77-entry-body .v77-qc-section,
.v77-journal-list .v77-entry-body .v77-bg-image-box,
.v77-journal-list .v77-entry-body .v77-entry-actions-footer,
.v77-journal-list .v77-entry-body .v77-links-commit-bar,
.v77-journal-list .v77-entry-body .v77-diary-commit-bar {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.v77-journal-list .v77-enddate-controls {
  flex-wrap: wrap;
  max-width: 100%;
}

.v77-journal-list .v77-enddate-controls input {
  min-width: 0;
}

/* Type color accents on Cronache & Background add toolbar buttons */
.v77-add[data-add-type="diary"] svg {
  color: var(--v8-type-diary-accent);
}

.v77-add[data-add-type="note"] svg {
  color: var(--v8-type-note-accent);
}

.v77-add[data-add-type="quest"] svg {
  color: var(--v8-type-quest-accent);
}

.v77-add[data-add-type="background"] svg {
  color: var(--v8-type-bg-accent);
}

.v77-add[data-add-type="bg-image"] svg {
  color: #e5be76;
}

@media (max-width: 760px) {
  .v77-journal-list {
    gap: 7px;
  }

  .v77-journal-list .v77-summary,
  .v77-journal-list .v77-open .v77-summary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 38px;
    flex-wrap: nowrap;
    gap: 5px 10px;
    padding: 10px;
    min-height: 54px;
  }

  .v77-journal-list .v77-emblem,
  .v77-journal-list .v77-open .v77-emblem {
    grid-column: 1;
    grid-row: 1;
    width: 34px;
    height: 34px;
    align-self: start;
    margin-top: 1px;
  }

  .v77-journal-list .v77-emblem svg,
  .v77-journal-list .v77-open .v77-emblem svg {
    width: 18px;
    height: 18px;
  }

  .v77-journal-list .v77-caption,
  .v77-journal-list .v77-open .v77-caption {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
  }

  .v77-journal-list .v77-entry-title {
    font-size: 15.5px;
  }

  .v77-journal-list .v77-entry-date-group,
  .v77-journal-list .v77-open .v77-entry-date-group {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    justify-content: flex-start;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .v77-journal-list .v77-entry-date,
  .v77-journal-list .v77-open .v77-entry-date {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    font-size: 12px;
    padding: 3px 8px;
  }

  .v77-journal-list .v77-open-hint,
  .v77-journal-list .v77-open .v77-open-hint {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    width: 38px;
    height: 38px;
    text-align: center;
  }

  .v77-journal-list .v77-open-hint::after {
    display: none;
  }

  .v77-journal-list .v77-entry-body {
    padding: 12px;
    max-height: none;
    overflow-y: visible;
  }

  .v77-journal-list .v77-entry-body textarea {
    min-height: 240px;
    padding: 12px;
    font-size: 16px;
  }

  .v77-journal-list .v77-entry-body textarea.v77-bg-img-desc {
    min-height: 88px;
  }

  .v77-bg-toolbar .v77-bg-search {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

@media print {
  .v77-journal-list {
    display: block;
  }

  .v77-journal-list .v77-summary,
  .v77-journal-list .v77-open .v77-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 8px 0;
  }

  .v77-journal-list .v77-entry-body {
    max-height: none !important;
    overflow: visible !important;
  }

  .v77-journal-list .v77-open-hint::after,
  .v77-close-card-btn,
  .v77-camp-dd,
  .v77-date-filter-group,
  .v77-date-filter-warn,
  .v77-date-filter-active {
    display: none !important;
  }
}

/* =========================================================
   VERSIONE 8 — FILTRO DATA (DAL / AL) & FILTRO CAMPAGNA
   CON ICONE ACCESSIBILE
   ========================================================= */
.v77-header-controls-slot .toolbar,
.v77-journal .toolbar {
  align-items: center;
}

.v77-filters-row .v77-type-label input,
.v77-filters-row .v77-type-label select,
.v77-bg-filters-row .v77-type-label select {
  width: 100%;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 6px 9px;
  font-size: 13.5px;
  line-height: 1.25;
  border: 1px solid rgba(195, 158, 98, 0.45);
  border-radius: 7px;
  background: #121015;
  color: #f3ece2;
  box-sizing: border-box;
}

.v77-filters-row .v77-type-label input:focus-visible,
.v77-filters-row .v77-type-label select:focus-visible,
.v77-bg-filters-row .v77-type-label select:focus-visible {
  outline: 2px solid #e6c686;
  outline-offset: 1px;
  border-color: #d8b476;
}

.v77-date-filter-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.v77-date-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 126px;
  width: 142px;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted, #b6b0a6);
  font-size: 13px;
  box-sizing: border-box;
}

.v77-date-filter-field input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  height: 36px;
  margin: 0;
  padding: 6px 9px;
  font-size: 13.5px;
  line-height: 1.25;
  text-align: left;
  border: 1px solid rgba(195, 158, 98, 0.45);
  border-radius: 7px;
  background: #121015;
  color: #f3ece2;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.v77-date-filter-field input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.v77-date-filter-field input[type="date"]:focus-visible {
  outline: 2px solid #e6c686;
  outline-offset: 1px;
  border-color: #d8b476;
}

.v77-date-filter-group.is-active .v77-date-filter-field input[type="date"] {
  border-color: #d8b476;
  background: #1b1318;
}

.v77-date-filter-group.is-invalid .v77-date-filter-field input[type="date"] {
  border-color: #df6975;
  background: #231216;
}

.v77-clear-date-filter-btn {
  align-self: flex-end;
  flex: 0 0 auto;
  height: 36px;
  min-height: 36px;
  margin: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.v77-clear-date-filter-btn[hidden] {
  display: none !important;
}

.v77-reset-filters-btn,
.v77-bg-reset-btn {
  align-self: flex-end;
  height: 36px;
  min-height: 36px;
  margin: 0;
  box-sizing: border-box;
}

.v77-date-filter-warn {
  margin: 8px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #d46a76;
  background: rgba(94, 24, 36, 0.45);
  color: #ffdce1;
  font-size: 13px;
  line-height: 1.4;
}

.v77-date-filter-warn[hidden],
.v77-date-filter-active[hidden],
.v77-camp-active-pill[hidden] {
  display: none !important;
}

.v77-active-filters-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 8px;
}

.v77-date-filter-active,
.v77-camp-active-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(216, 180, 118, 0.5);
  background: rgba(58, 25, 34, 0.55);
  color: #f5e6cc;
  font-size: 12.5px;
  line-height: 1.35;
}

.v77-camp-active-ico {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--gold, #d8b476);
}

.v77-camp-active-ico svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.v77-camp-clear-inline {
  padding: 2px 8px;
  min-height: 24px;
  font-size: 11.5px;
}

/* Custom accessible Campaign dropdown aligned in toolbar */
.v77-camp-dd {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}

.v77-camp-dd .v77-camp-dd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  text-align: left;
  box-sizing: border-box;
}

.v77-camp-dd .v77-camp-dd-trigger.is-active {
  border-color: #e2c287;
  background: linear-gradient(155deg, #5d252b, #36181e);
  color: #fff3da;
  box-shadow: 0 0 0 1px rgba(216, 180, 118, 0.3);
}

.v77-camp-dd-trigger-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.v77-camp-dd-label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}

.v77-camp-dd-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--gold, #d8b476);
}

.v77-camp-dd-ico svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-camp-dd-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--gold, #d8b476);
  transition: transform 0.15s ease;
}

.v77-camp-dd-trigger[aria-expanded="true"] .v77-camp-dd-caret {
  transform: rotate(180deg);
}

.v77-camp-dd-caret svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.v77-camp-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 230px;
  max-width: min(330px, calc(100vw - 24px));
  max-height: min(340px, 60dvh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #b58c52;
  background: linear-gradient(165deg, #24171d, #141116);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.72);
  box-sizing: border-box;
}

.v77-camp-dd-menu.align-right {
  left: auto;
  right: 0;
}

.v77-camp-dd-menu[hidden] {
  display: none !important;
}

.v77-camp-dd-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #f0e4ce;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  box-sizing: border-box;
}

.v77-camp-dd-opt:hover,
.v77-camp-dd-opt:focus-visible,
.v77-camp-dd-opt.is-focused {
  background: rgba(102, 37, 48, 0.65);
  border-color: rgba(216, 180, 118, 0.55);
  color: #fff6e2;
  outline: none;
}

.v77-camp-dd-opt[aria-selected="true"] {
  background: linear-gradient(155deg, rgba(112, 41, 52, 0.85), rgba(62, 23, 31, 0.9));
  border-color: #d8b476;
  color: #fff5df;
  font-weight: 600;
}

.v77-camp-dd-opt-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.v77-camp-dd-opt-check {
  flex: 0 0 auto;
  color: var(--gold, #d8b476);
  font-size: 13px;
  font-weight: 700;
}

.v77-bg-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.v77-bg-filters-row .v77-bg-search {
  min-height: 36px;
  margin: 0;
  box-sizing: border-box;
}

.v77-bg-filters-row .v77-bg-type-label {
  flex: 0 1 200px;
  min-width: 170px;
  margin: 0;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .v77-filters-row,
  .v77-bg-filters-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    box-sizing: border-box;
  }

  .v77-bg-filters-row .v77-bg-search,
  .v77-bg-filters-row .v77-bg-type-label {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .v77-date-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    margin: 0;
    padding: 0;
    align-items: end;
    box-sizing: border-box;
  }

  .v77-date-filter-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  .v77-date-filter-field input[type="date"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 6px 8px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }

  .v77-clear-date-filter-btn {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
  }

  .v77-camp-dd {
    width: 100%;
  }

  .v77-camp-dd-trigger {
    width: 100%;
  }

  .v77-camp-dd-menu {
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .v77-type-label {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .v77-date-filter-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .v77-clear-date-filter-btn {
    width: 100%;
    justify-self: stretch;
  }
}

/* =========================================================
   7even — Diary Books Shelf (Square Leather Covers), Open Book Bar & Modal
   ========================================================= */
.v77-diary-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.v77-diary-shelf[hidden],
.v77-diary-book-card[hidden],
.v77-diary-unassigned-section[hidden] {
  display: none !important;
}

.v77-diary-book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.v77-diary-book-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  cursor: pointer;
}

.v77-diary-book-cover {
  --book-bg-top: #331e24;
  --book-bg-mid: #21151b;
  --book-bg-bot: #151015;
  --book-glow: rgba(168, 124, 68, 0.16);
  --book-border: rgba(186, 146, 86, 0.56);
  --book-accent: #e8c787;
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 6px 12px 12px 6px;
  border: 1px solid var(--book-border);
  background:
    radial-gradient(circle at 54% 46%, var(--book-glow), transparent 60%),
    linear-gradient(150deg, var(--book-bg-top) 0%, var(--book-bg-mid) 52%, var(--book-bg-bot) 100%);
  box-shadow:
    inset 14px 0 18px -10px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(226, 190, 128, 0.14),
    0 8px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.v77-diary-book-cover[data-cover-color="bordeaux"],
.v77-diary-cover-preview[data-cover-color="bordeaux"],
.v77-open-book-bar[data-cover-color="bordeaux"],
.v77-entry[data-cover-color="bordeaux"] {
  --book-bg-top: #331e24;
  --book-bg-mid: #21151b;
  --book-bg-bot: #151015;
  --book-glow: rgba(168, 124, 68, 0.16);
  --book-border: rgba(186, 146, 86, 0.58);
  --book-accent: #e8c787;
  --book-card-stripe: #a64b5c;
  --book-card-bg: linear-gradient(160deg, rgba(56, 26, 34, 0.42), rgba(20, 15, 20, 0.94));
}

.v77-diary-book-cover[data-cover-color="obsidian"],
.v77-diary-cover-preview[data-cover-color="obsidian"],
.v77-open-book-bar[data-cover-color="obsidian"],
.v77-entry[data-cover-color="obsidian"] {
  --book-bg-top: #28252d;
  --book-bg-mid: #1a1820;
  --book-bg-bot: #100f14;
  --book-glow: rgba(212, 178, 114, 0.15);
  --book-border: rgba(199, 162, 98, 0.58);
  --book-accent: #ebd096;
  --book-card-stripe: #c7a262;
  --book-card-bg: linear-gradient(160deg, rgba(44, 40, 50, 0.54), rgba(16, 15, 20, 0.96));
}

.v77-diary-book-cover[data-cover-color="emerald"],
.v77-diary-cover-preview[data-cover-color="emerald"],
.v77-open-book-bar[data-cover-color="emerald"],
.v77-entry[data-cover-color="emerald"] {
  --book-bg-top: #1c3429;
  --book-bg-mid: #14251e;
  --book-bg-bot: #0e1713;
  --book-glow: rgba(132, 188, 146, 0.18);
  --book-border: rgba(127, 168, 134, 0.6);
  --book-accent: #cbe8cf;
  --book-card-stripe: #68a87a;
  --book-card-bg: linear-gradient(160deg, rgba(28, 56, 42, 0.48), rgba(14, 22, 18, 0.95));
}

.v77-diary-book-cover[data-cover-color="sapphire"],
.v77-diary-cover-preview[data-cover-color="sapphire"],
.v77-open-book-bar[data-cover-color="sapphire"],
.v77-entry[data-cover-color="sapphire"] {
  --book-bg-top: #1c2940;
  --book-bg-mid: #141d2e;
  --book-bg-bot: #0e131e;
  --book-glow: rgba(126, 168, 224, 0.18);
  --book-border: rgba(127, 162, 204, 0.6);
  --book-accent: #c7dff7;
  --book-card-stripe: #6994c9;
  --book-card-bg: linear-gradient(160deg, rgba(28, 42, 68, 0.5), rgba(14, 19, 30, 0.95));
}

.v77-diary-book-cover[data-cover-color="amethyst"],
.v77-diary-cover-preview[data-cover-color="amethyst"],
.v77-open-book-bar[data-cover-color="amethyst"],
.v77-entry[data-cover-color="amethyst"] {
  --book-bg-top: #311f3d;
  --book-bg-mid: #21152a;
  --book-bg-bot: #140e1a;
  --book-glow: rgba(196, 142, 228, 0.18);
  --book-border: rgba(180, 130, 204, 0.6);
  --book-accent: #e5c6f7;
  --book-card-stripe: #b074cf;
  --book-card-bg: linear-gradient(160deg, rgba(54, 32, 68, 0.48), rgba(20, 14, 26, 0.95));
}

.v77-diary-book-cover[data-cover-color="crimson"],
.v77-diary-cover-preview[data-cover-color="crimson"],
.v77-open-book-bar[data-cover-color="crimson"],
.v77-entry[data-cover-color="crimson"] {
  --book-bg-top: #471a22;
  --book-bg-mid: #2f1218;
  --book-bg-bot: #1a0c10;
  --book-glow: rgba(218, 122, 108, 0.18);
  --book-border: rgba(207, 127, 117, 0.6);
  --book-accent: #f3c8ad;
  --book-card-stripe: #c95d57;
  --book-card-bg: linear-gradient(160deg, rgba(72, 26, 34, 0.48), rgba(24, 12, 16, 0.95));
}

.v77-diary-book-cover[data-cover-color="bronze"],
.v77-diary-cover-preview[data-cover-color="bronze"],
.v77-open-book-bar[data-cover-color="bronze"],
.v77-entry[data-cover-color="bronze"] {
  --book-bg-top: #3d2b19;
  --book-bg-mid: #291d12;
  --book-bg-bot: #18110b;
  --book-glow: rgba(218, 168, 94, 0.19);
  --book-border: rgba(200, 154, 86, 0.62);
  --book-accent: #f2d59c;
  --book-card-stripe: #c89a56;
  --book-card-bg: linear-gradient(160deg, rgba(64, 44, 24, 0.48), rgba(22, 16, 11, 0.95));
}

.v77-diary-book-cover[data-cover-color="slate"],
.v77-diary-cover-preview[data-cover-color="slate"],
.v77-open-book-bar[data-cover-color="slate"],
.v77-entry[data-cover-color="slate"] {
  --book-bg-top: #252e36;
  --book-bg-mid: #1a2127;
  --book-bg-bot: #111519;
  --book-glow: rgba(158, 184, 204, 0.17);
  --book-border: rgba(143, 166, 184, 0.58);
  --book-accent: #d7e5f0;
  --book-card-stripe: #88a4ba;
  --book-card-bg: linear-gradient(160deg, rgba(38, 48, 56, 0.5), rgba(16, 20, 24, 0.95));
}

.v77-diary-book-cover[data-cover-color="forest"],
.v77-diary-cover-preview[data-cover-color="forest"],
.v77-open-book-bar[data-cover-color="forest"],
.v77-entry[data-cover-color="forest"] {
  --book-bg-top: #253b22;
  --book-bg-mid: #192917;
  --book-bg-bot: #0f180e;
  --book-glow: rgba(154, 198, 120, 0.18);
  --book-border: rgba(140, 182, 112, 0.6);
  --book-accent: #d4ebbf;
  --book-card-stripe: #7ca85d;
  --book-card-bg: linear-gradient(160deg, rgba(38, 60, 34, 0.5), rgba(14, 22, 13, 0.95));
}

.v77-diary-book-cover[data-cover-color="teal"],
.v77-diary-cover-preview[data-cover-color="teal"],
.v77-open-book-bar[data-cover-color="teal"],
.v77-entry[data-cover-color="teal"] {
  --book-bg-top: #183a3e;
  --book-bg-mid: #11292c;
  --book-bg-bot: #0b191b;
  --book-glow: rgba(112, 196, 202, 0.19);
  --book-border: rgba(102, 178, 184, 0.6);
  --book-accent: #c1ecef;
  --book-card-stripe: #4fa9b0;
  --book-card-bg: linear-gradient(160deg, rgba(24, 60, 64, 0.5), rgba(11, 24, 26, 0.95));
}

.v77-diary-book-cover[data-cover-color="indigo"],
.v77-diary-cover-preview[data-cover-color="indigo"],
.v77-open-book-bar[data-cover-color="indigo"],
.v77-entry[data-cover-color="indigo"] {
  --book-bg-top: #25264c;
  --book-bg-mid: #191a36;
  --book-bg-bot: #101122;
  --book-glow: rgba(146, 150, 232, 0.19);
  --book-border: rgba(138, 142, 214, 0.6);
  --book-accent: #d4d6fa;
  --book-card-stripe: #7c80d4;
  --book-card-bg: linear-gradient(160deg, rgba(38, 40, 78, 0.5), rgba(15, 16, 32, 0.95));
}

.v77-diary-book-cover[data-cover-color="plum"],
.v77-diary-cover-preview[data-cover-color="plum"],
.v77-open-book-bar[data-cover-color="plum"],
.v77-entry[data-cover-color="plum"] {
  --book-bg-top: #401c39;
  --book-bg-mid: #2b1327;
  --book-bg-bot: #190b17;
  --book-glow: rgba(214, 134, 196, 0.18);
  --book-border: rgba(196, 122, 178, 0.6);
  --book-accent: #f0c8e6;
  --book-card-stripe: #b866a5;
  --book-card-bg: linear-gradient(160deg, rgba(64, 28, 56, 0.5), rgba(24, 11, 22, 0.95));
}

.v77-diary-book-cover[data-cover-color="rose"],
.v77-diary-cover-preview[data-cover-color="rose"],
.v77-open-book-bar[data-cover-color="rose"],
.v77-entry[data-cover-color="rose"] {
  --book-bg-top: #472431;
  --book-bg-mid: #311822;
  --book-bg-bot: #1d0e14;
  --book-glow: rgba(232, 154, 176, 0.19);
  --book-border: rgba(214, 138, 160, 0.6);
  --book-accent: #f7d2dc;
  --book-card-stripe: #cf7a95;
  --book-card-bg: linear-gradient(160deg, rgba(72, 36, 50, 0.5), rgba(26, 14, 19, 0.95));
}

.v77-diary-book-cover[data-cover-color="amber"],
.v77-diary-cover-preview[data-cover-color="amber"],
.v77-open-book-bar[data-cover-color="amber"],
.v77-entry[data-cover-color="amber"] {
  --book-bg-top: #4a3216;
  --book-bg-mid: #32210e;
  --book-bg-bot: #1d1308;
  --book-glow: rgba(238, 182, 86, 0.2);
  --book-border: rgba(220, 166, 78, 0.64);
  --book-accent: #fae0a8;
  --book-card-stripe: #d99b38;
  --book-card-bg: linear-gradient(160deg, rgba(76, 50, 22, 0.5), rgba(26, 18, 9, 0.95));
}

.v77-diary-book-cover[data-cover-color="copper"],
.v77-diary-cover-preview[data-cover-color="copper"],
.v77-open-book-bar[data-cover-color="copper"],
.v77-entry[data-cover-color="copper"] {
  --book-bg-top: #472619;
  --book-bg-mid: #301a11;
  --book-bg-bot: #1b0f0a;
  --book-glow: rgba(226, 146, 108, 0.19);
  --book-border: rgba(208, 134, 96, 0.62);
  --book-accent: #f4cfb8;
  --book-card-stripe: #cc7952;
  --book-card-bg: linear-gradient(160deg, rgba(72, 38, 25, 0.5), rgba(24, 14, 10, 0.95));
}

.v77-diary-book-cover[data-cover-color="ivory"],
.v77-diary-cover-preview[data-cover-color="ivory"],
.v77-open-book-bar[data-cover-color="ivory"],
.v77-entry[data-cover-color="ivory"] {
  --book-bg-top: #3f392d;
  --book-bg-mid: #2b271f;
  --book-bg-bot: #191712;
  --book-glow: rgba(228, 216, 186, 0.18);
  --book-border: rgba(206, 194, 164, 0.6);
  --book-accent: #f2ead4;
  --book-card-stripe: #bfb292;
  --book-card-bg: linear-gradient(160deg, rgba(64, 58, 46, 0.52), rgba(24, 22, 18, 0.95));
}

/* Section Color Inheritance for Unassociated Pages / Entries */
.v77-entry[data-cover-color="section-retaggio"] {
  --book-bg-top: #1c3429;
  --book-bg-mid: #14251e;
  --book-bg-bot: #0e1713;
  --book-glow: rgba(110, 182, 138, 0.18);
  --book-border: rgba(111, 168, 130, 0.58);
  --book-accent: #bfe5c7;
  --book-card-stripe: #68a87a;
  --book-card-bg: linear-gradient(160deg, rgba(25, 52, 38, 0.5), rgba(14, 21, 18, 0.95));
}

.v77-entry[data-cover-color="section-cronache"] {
  --book-bg-top: #382a18;
  --book-bg-mid: #261c12;
  --book-bg-bot: #16110c;
  --book-glow: rgba(216, 180, 118, 0.18);
  --book-border: rgba(204, 164, 96, 0.58);
  --book-accent: #eed196;
  --book-card-stripe: #c99d56;
  --book-card-bg: linear-gradient(160deg, rgba(58, 42, 22, 0.48), rgba(20, 16, 13, 0.95));
}

.v77-entry[data-cover-color="section-obiettivi"] {
  --book-bg-top: #1b2d3f;
  --book-bg-mid: #13202e;
  --book-bg-bot: #0d141d;
  --book-glow: rgba(120, 168, 218, 0.18);
  --book-border: rgba(114, 156, 198, 0.58);
  --book-accent: #c4dff7;
  --book-card-stripe: #6894c6;
  --book-card-bg: linear-gradient(160deg, rgba(25, 44, 66, 0.5), rgba(13, 19, 28, 0.95));
}

/* Book / Scroll Cover Color Inheritance on Linked Entry Cards */
.v77-entry[data-cover-color]:not([data-cover-color=""]) {
  border-color: var(--book-border);
  border-left: 4px solid var(--book-card-stripe, var(--book-border));
  background: var(--book-card-bg, linear-gradient(160deg, var(--book-bg-top), var(--book-bg-bot)));
}

.v77-entry[data-cover-color]:not([data-cover-color=""]) .v77-emblem {
  border-color: var(--book-border);
  background: radial-gradient(circle, var(--book-glow), rgba(15, 13, 18, 0.82));
  color: var(--book-accent);
}

.v77-entry[data-cover-color]:not([data-cover-color=""]) .v77-entry-title {
  color: var(--book-accent);
}

.v77-entry[data-cover-color]:not([data-cover-color=""]) .v77-type-tag {
  border-color: var(--book-border);
  color: var(--book-accent);
}

.v77-entry[data-cover-color]:not([data-cover-color=""]) .v77-entry-body {
  border-top-color: var(--book-border);
}

/* Parchment Scroll Variant for Obiettivi */
.v77-diary-book-cover.v77-scroll-cover {
  border-radius: 14px;
  padding: 18px 14px;
  box-sizing: border-box;
  box-shadow:
    inset 0 14px 18px -12px rgba(0, 0, 0, 0.78),
    inset 0 -14px 18px -12px rgba(0, 0, 0, 0.78),
    inset 0 0 0 1px rgba(232, 199, 135, 0.16),
    0 8px 20px rgba(0, 0, 0, 0.48);
}

.v77-diary-book-cover.v77-scroll-cover::before,
.v77-diary-book-cover.v77-scroll-cover::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 12px;
  top: auto;
  bottom: auto;
  width: auto;
  border-radius: 999px;
  border: 1px solid var(--book-border, rgba(216, 180, 118, 0.56));
  background: linear-gradient(90deg, rgba(16, 12, 16, 0.92), var(--book-bg-top, #331e24) 22%, var(--book-accent, #e8c787) 50%, var(--book-bg-top, #331e24) 78%, rgba(16, 12, 16, 0.92));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.v77-diary-book-cover.v77-scroll-cover::before {
  top: 6px;
}

.v77-diary-book-cover.v77-scroll-cover::after {
  bottom: 6px;
  inset: auto 6px 6px 6px;
}

.v77-diary-book-cover.v77-scroll-cover .v77-diary-book-ico {
  margin-left: 0;
}

.v77-diary-book-cover.v77-scroll-cover .v77-diary-book-count {
  bottom: 22px;
}

.v77-diary-cover-preview.is-scroll {
  border-radius: 12px;
  padding: 14px 8px;
  position: relative;
  box-shadow:
    inset 0 10px 12px -8px rgba(0, 0, 0, 0.75),
    inset 0 -10px 12px -8px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 232, 188, 0.14);
}

.v77-diary-cover-preview.is-scroll::before,
.v77-diary-cover-preview.is-scroll::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--book-border, rgba(216, 180, 118, 0.56));
  background: linear-gradient(90deg, rgba(16, 12, 16, 0.9), var(--book-bg-top, #331e24) 25%, var(--book-accent, #e8c787) 50%, var(--book-bg-top, #331e24) 75%, rgba(16, 12, 16, 0.9));
  pointer-events: none;
}

.v77-diary-cover-preview.is-scroll::before {
  top: 4px;
}

.v77-diary-cover-preview.is-scroll::after {
  bottom: 4px;
}

.v77-diary-cover-preview {
  border-color: var(--book-border, rgba(216, 180, 118, 0.56));
  background:
    radial-gradient(circle at 54% 46%, var(--book-glow, rgba(168, 124, 68, 0.16)), transparent 62%),
    linear-gradient(150deg, var(--book-bg-top, #341e25), var(--book-bg-bot, #181117));
}

.v77-diary-cover-preview-ico {
  border-color: var(--book-border, rgba(232, 199, 135, 0.54));
  color: var(--book-accent, #e8c787);
}

/* Emblem thumb support for Cronache & Obiettivi image entries too */
.v77-entry[data-bg-kind="image"] .v77-emblem.has-thumb > svg {
  display: none;
}

.v77-diary-book-cover::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, rgba(216, 180, 118, 0.25), rgba(216, 180, 118, 0.55), rgba(216, 180, 118, 0.25));
  pointer-events: none;
}

.v77-diary-book-cover::after {
  content: "";
  position: absolute;
  inset: 9px 9px 9px 19px;
  border: 1px solid rgba(216, 180, 118, 0.24);
  border-radius: 4px 7px 7px 4px;
  pointer-events: none;
}

.v77-diary-book-open:hover .v77-diary-book-cover,
.v77-diary-book-open:focus-visible .v77-diary-book-cover {
  transform: translateY(-2px);
  border-color: var(--book-accent, #e4c17f);
  box-shadow:
    inset 14px 0 18px -10px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(228, 193, 127, 0.34),
    0 12px 24px rgba(0, 0, 0, 0.56);
}

.v77-diary-book-ico {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60%;
  height: 60%;
  min-width: 82px;
  min-height: 82px;
  max-width: 124px;
  max-height: 124px;
  border-radius: 50%;
  border: 1.5px solid var(--book-border, rgba(216, 180, 118, 0.48));
  background: radial-gradient(circle, var(--book-glow, rgba(216, 180, 118, 0.16)), rgba(14, 11, 16, 0.62));
  color: var(--book-accent, #e8c787);
  margin-left: 8px;
}

.v77-diary-book-ico svg {
  width: 68%;
  height: 68%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-diary-book-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(186, 148, 92, 0.45);
  background: rgba(15, 13, 17, 0.84);
  color: #e4d2b4;
  font-size: 10.5px;
  font-weight: 700;
}

.v77-diary-book-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.v77-diary-book-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14.5px;
  line-height: 1.3;
  color: #f4e2bf;
  overflow-wrap: anywhere;
}

.v77-diary-book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted, #b6b0a6);
}

.v77-diary-book-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(196, 158, 98, 0.62);
  background: rgba(20, 16, 22, 0.88);
  color: #e8c787;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.v77-diary-book-edit-btn:hover,
.v77-diary-book-edit-btn:focus-visible {
  background: rgba(104, 38, 49, 0.94);
  border-color: #f0d090;
  color: #fff8ea;
  transform: scale(1.05);
}

.v77-diary-book-edit-btn svg {
  width: 15px;
  height: 15px;
}

/* Open Diary Book Banner */
.v77-open-book-bar {
  --book-bg-top: #331e24;
  --book-bg-bot: #151015;
  --book-border: rgba(186, 148, 92, 0.56);
  --book-accent: #e8c787;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--book-border);
  background: linear-gradient(150deg, var(--book-bg-top), var(--book-bg-bot));
}

.v77-open-book-back,
.v77-open-book-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.v77-open-book-back svg,
.v77-open-book-edit svg {
  width: 15px;
  height: 15px;
}

.v77-open-book-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 220px;
}

.v77-open-book-ico {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid var(--book-border, rgba(216, 180, 118, 0.48));
  background: rgba(16, 14, 19, 0.78);
  color: var(--book-accent, #e8c787);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.v77-open-book-ico svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-open-book-titles {
  min-width: 0;
}

.v77-open-book-titles h3 {
  margin: 0 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  color: #f4ddb2;
  overflow-wrap: anywhere;
}

.v77-open-book-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #b6b0a6);
}

.v77-open-book-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
}

.v77-open-book-empty .mpg-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.v77-open-book-empty .mpg-new-btn svg {
  width: 16px;
  height: 16px;
}

.v77-diary-unassigned-section {
  margin-top: 8px;
}

.v77-diary-unassigned-section .v77-unassigned-divider {
  margin: 24px 0 18px;
}

.v77-diary-unassigned-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  letter-spacing: 0.4px;
  color: #e2c693;
}

.v77-unassigned-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px dashed rgba(216, 180, 118, 0.56);
  background: rgba(24, 18, 22, 0.85);
  color: #e6c688;
  flex: 0 0 auto;
}

.v77-unassigned-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-diary-unassigned-sub {
  margin: -6px 0 12px;
  font-size: 12.5px;
}

/* Diary Book Create / Edit Dialog */
.v77-diary-book-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #9d7d4d;
  background: linear-gradient(160deg, #211920, #131117);
  color: #efe8dc;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.78);
}

.v77-diary-book-dialog::backdrop {
  background: rgba(6, 5, 10, 0.76);
  backdrop-filter: blur(2px);
}

.v77-diary-book-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(186, 148, 92, 0.32);
}

.v77-diary-book-modal-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #f4ddb2;
}

.v77-diary-book-close {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v77-diary-book-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v77-diary-book-modal-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.v77-diary-cover-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(145, 118, 82, 0.34);
  background: rgba(16, 14, 20, 0.72);
}

.v77-diary-cover-preview {
  width: 116px;
  height: 116px;
  border-radius: 6px 12px 12px 6px;
  border: 1px solid var(--book-border, rgba(216, 180, 118, 0.56));
  background:
    radial-gradient(circle at 54% 46%, var(--book-glow, rgba(168, 124, 68, 0.16)), transparent 62%),
    linear-gradient(150deg, var(--book-bg-top, #341e25), var(--book-bg-bot, #181117));
  box-shadow:
    inset 12px 0 14px -8px rgba(0, 0, 0, 0.78),
    inset 0 0 0 1px rgba(255, 232, 188, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px 8px 14px;
  flex-shrink: 0;
  text-align: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.v77-diary-cover-preview-ico {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 1px solid var(--book-border, rgba(232, 199, 135, 0.54));
  background: radial-gradient(circle at 35% 30%, var(--book-glow, rgba(232, 199, 135, 0.24)), rgba(14, 10, 14, 0.62));
  color: var(--book-accent, #e8c787);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v77-diary-cover-preview-ico svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-diary-cover-preview-title {
  font-size: 10px;
  line-height: 1.15;
  color: #f0dfb8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v77-diary-cover-preview-hint {
  margin: 0;
  font-size: 13px;
}

.v77-diary-color-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v77-diary-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.v77-diary-color-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(128, 106, 78, 0.45);
  background: rgba(20, 18, 25, 0.85);
  color: #dfd2be;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.v77-diary-color-opt:hover,
.v77-diary-color-opt:focus-visible {
  border-color: #d8b476;
  background: rgba(54, 34, 42, 0.72);
  color: #fff3dc;
}

.v77-diary-color-opt.is-selected {
  border-color: #e8c787;
  background: linear-gradient(155deg, rgba(92, 46, 56, 0.88), rgba(38, 22, 30, 0.94));
  color: #fff7e6;
  box-shadow: 0 0 0 1px rgba(232, 199, 135, 0.45);
}

.v77-diary-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(240, 212, 152, 0.65);
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.16), 0 1px 4px rgba(0, 0, 0, 0.45);
}

.v77-diary-color-lbl {
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v77-diary-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
}

.v77-diary-icon-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid rgba(128, 106, 78, 0.45);
  background: rgba(20, 18, 25, 0.85);
  color: #dfd2be;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.v77-diary-icon-opt:hover,
.v77-diary-icon-opt:focus-visible {
  border-color: #d8b476;
  background: rgba(60, 32, 40, 0.72);
  color: #fff3dc;
}

.v77-diary-icon-opt.is-selected {
  border-color: #e8c787;
  background: linear-gradient(155deg, rgba(108, 42, 52, 0.88), rgba(45, 22, 28, 0.94));
  color: #fff7e6;
  box-shadow: 0 0 0 1px rgba(232, 199, 135, 0.4);
}

.v77-diary-icon-opt-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e4c17f;
}

.v77-diary-icon-opt-svg svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v77-diary-icon-opt-lbl {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.v77-inherited-campaign-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(186, 152, 98, 0.42);
  background: rgba(22, 18, 26, 0.72);
  color: #e5d5b7;
  font-size: 12.5px;
  line-height: 1.3;
}

.v77-diary-book-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(138, 112, 76, 0.3);
}

.v77-diary-book-modal-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .v77-diary-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .v77-diary-book-ico {
    width: 62%;
    height: 62%;
    min-width: 68px;
    min-height: 68px;
    max-width: 96px;
    max-height: 96px;
  }

  .v77-diary-book-ico svg {
    width: 68%;
    height: 68%;
  }

  .v77-diary-cover-preview {
    width: 96px;
    height: 96px;
  }

  .v77-diary-cover-preview-ico {
    width: 54px;
    height: 54px;
  }

  .v77-diary-cover-preview-ico svg {
    width: 34px;
    height: 34px;
  }

  .v77-diary-book-modal-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .v77-diary-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v77-diary-icon-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 240px;
  }
}

/* =========================================================
   Obiettivi — Spunta "Obiettivo completato" & Timbro in Ceralacca Rosso
   ========================================================= */
.v77-diary-book-form .v77-obj-completed-toggle {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(186, 146, 86, 0.36);
  background: rgba(24, 18, 22, 0.78);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.v77-diary-book-form .v77-obj-completed-toggle:hover {
  border-color: rgba(216, 180, 118, 0.6);
  background: rgba(32, 22, 27, 0.88);
}

.v77-diary-book-form .v77-obj-completed-toggle.is-checked {
  border-color: rgba(196, 62, 72, 0.72);
  background: linear-gradient(150deg, rgba(64, 18, 24, 0.52), rgba(24, 15, 19, 0.92));
}

.v77-diary-book-form .v77-obj-completed-check {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  padding: 0;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: #b81d27;
  cursor: pointer;
}

.v77-obj-completed-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v77-obj-completed-title {
  font-size: 13px;
  font-weight: 700;
  color: #f4e2bf;
  line-height: 1.3;
}

.v77-obj-completed-sub {
  font-size: 11.5px;
  line-height: 1.38;
  color: var(--muted, #b6b0a6);
}

.v77-wax-seal {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.72));
  transform: rotate(-5deg);
}

.v77-wax-seal[hidden] {
  display: none !important;
}

.v77-wax-seal-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.v77-diary-cover-preview.is-scroll .v77-wax-seal.is-preview {
  left: 3px;
  bottom: 3px;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.68));
}

@media (max-width: 640px) {
  .v77-diary-book-cover.v77-scroll-cover .v77-wax-seal {
    left: 5px;
    bottom: 5px;
    width: 42px;
    height: 42px;
  }
}



