/* =========================================================
   DIARIO DI ALYNDRA v7.13 — Sistema Multi-PG, Campagne, Sessione & Archivio Locale
   ========================================================= */

body.mpg-home-active {
  padding-top: 0 !important;
}

body.mpg-home-active > header,
body.mpg-home-active > .shell {
  display: none !important;
}

#mpg-home-screen {
  min-height: 100dvh;
  padding: 36px 24px 64px;
  background:
    radial-gradient(ellipse at top center, #42262e55, transparent 60%),
    radial-gradient(ellipse at bottom right, #2e241844, transparent 55%),
    var(--bg, #101011);
}

.mpg-container {
  max-width: 1080px;
  margin: 0 auto;
}

.mpg-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 30px 58px 26px;
  border: 1px solid var(--border, #79694e);
  border-radius: 12px;
  background:
    linear-gradient(155deg, rgba(28, 22, 26, 0.94), rgba(16, 16, 20, 0.96)),
    url('assets/cavern.svg') center/cover;
  box-shadow: 0 14px 38px #0008;
  margin-bottom: 22px;
}

.mpg-hero.has-custom-bg {
  background-color: #141218;
}

.mpg-hero.has-custom-bg .mpg-eyebrow,
.mpg-hero.has-custom-bg h1,
.mpg-hero.has-custom-bg .mpg-subtitle {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.94), 0 1px 3px rgba(0, 0, 0, 0.96);
}

.mpg-hero-edit,
.mpg-campaign-edit {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #91764e;
  background: rgba(23, 20, 26, 0.88);
  color: var(--gold, #d8b476);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mpg-hero-edit:hover,
.mpg-hero-edit:focus-visible,
.mpg-campaign-edit:hover,
.mpg-campaign-edit:focus-visible {
  border-color: var(--gold, #d8b476);
  background: linear-gradient(155deg, #4b2831, #27181e);
  color: #fff3da;
  outline: 2px solid #f0cf8e66;
  outline-offset: 2px;
}

.mpg-hero-edit svg,
.mpg-campaign-edit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mpg-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold, #d8b476);
  margin-bottom: 8px;
}

.mpg-hero h1 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(25px, 4.1vw, 40px);
  letter-spacing: 1.6px;
  color: var(--ink, #ede9e2);
  overflow-wrap: anywhere;
}

.mpg-subtitle {
  margin: 0 auto;
  max-width: 640px;
  color: #ded6de;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

/* Home Archive Bar + Storage Notice (Fase 2) */
.mpg-archive-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid #5d4f3d;
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(28, 22, 26, 0.88), rgba(16, 15, 19, 0.94));
}

.mpg-archive-note-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 280px;
}

.mpg-archive-note {
  margin: 0;
  font-size: 13px;
  color: #e5dccb;
  line-height: 1.45;
}

.mpg-last-export-meta {
  font-size: 12px;
  color: #bfb5a3;
}

.mpg-archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  font-family: Georgia, serif;
  font-size: 14px;
  color: #f3dcaf;
  background: linear-gradient(155deg, #2d2329, #19161c);
  border: 1px solid #96784f;
  border-radius: 8px;
  cursor: pointer;
}

.mpg-archive-btn:hover,
.mpg-archive-btn:focus-visible {
  border-color: var(--gold, #d8b476);
  background: linear-gradient(155deg, #432b32, #241b20);
  color: #fff3da;
  outline: 2px solid #f0cf8e66;
  outline-offset: 2px;
}

.mpg-archive-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Filter bars (Fase 7) */
.mpg-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}

.mpg-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #4e4234;
  border-radius: 9px;
  background: rgba(22, 19, 24, 0.88);
}

.mpg-filter-bar-campaigns {
  grid-template-columns: minmax(0, 260px);
  width: fit-content;
  max-width: 100%;
}

.mpg-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin: 0 !important;
  font-size: 12px;
  color: #d6c8b2;
}

.mpg-filter-field input,
.mpg-filter-field select {
  width: 100%;
  min-height: 40px;
  margin: 0;
}

.mpg-count {
  font-size: 13px;
  color: var(--muted, #b6b0a6);
}

.mpg-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 15px;
  font-family: Georgia, serif;
  letter-spacing: 0.4px;
  color: #f9e6c1;
  background: linear-gradient(155deg, #5d252b, #36181e);
  border: 1px solid #b58c52;
  border-radius: 8px;
  box-shadow: 0 6px 18px #0007;
  cursor: pointer;
}

.mpg-new-btn:hover,
.mpg-new-btn:focus-visible {
  background: linear-gradient(155deg, #742e35, #472027);
  border-color: var(--gold, #d8b476);
  color: #fff6e2;
  outline: 2px solid #f0cf8e66;
  outline-offset: 2px;
}

.mpg-new-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.mpg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.mpg-home-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #6b5842;
  background: #1d1a1f;
  color: #efe4cf;
  font-size: 14px;
  line-height: 1.5;
}

.mpg-home-notice.is-success {
  border-color: #6b9158;
  background: linear-gradient(155deg, rgba(28, 43, 27, 0.92), rgba(18, 25, 18, 0.94));
  color: #dff3d8;
}

.mpg-home-notice.is-error {
  border-color: #c75353;
  background: linear-gradient(155deg, rgba(66, 22, 27, 0.94), rgba(36, 14, 17, 0.95));
  color: #ffd8d8;
}

.mpg-empty-archive {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 18px;
  border: 1px dashed #6b5842;
  border-radius: 11px;
  background: linear-gradient(155deg, rgba(28, 22, 26, 0.72), rgba(16, 16, 20, 0.85));
}

.mpg-empty-archive p {
  margin: 0 0 8px;
}

.mpg-empty-archive p:last-child {
  margin-bottom: 0;
}

.mpg-card-wrap {
  display: flex;
  flex-direction: column;
  padding: 10px 12px 16px;
  border: 1px solid #79694e;
  border-radius: 11px;
  background: linear-gradient(155deg, #211c21, #141418);
  box-shadow: 0 10px 26px #0006;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.mpg-card-wrap:hover,
.mpg-card-wrap:focus-within {
  transform: translateY(-2px);
  border-color: var(--gold, #d8b476);
  background: linear-gradient(155deg, #2a2127, #18171d);
  box-shadow: 0 14px 30px #0009, 0 0 0 1px #d8b47644;
}

.mpg-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 36px;
  margin-bottom: 4px;
}

.mpg-card-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid #7d6748;
  background: linear-gradient(155deg, #2b2126, #19161c);
  color: var(--gold, #d8b476);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mpg-card-edit:hover,
.mpg-card-edit:focus-visible {
  border-color: var(--gold, #d8b476);
  background: linear-gradient(155deg, #4b2831, #27181e);
  color: #fff3da;
}

.mpg-card-edit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mpg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 13px;
  flex: 1;
  width: 100%;
  padding: 4px 4px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.mpg-card:hover,
.mpg-card:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.mpg-card:focus-visible {
  outline: 2px solid var(--gold, #d8b476);
  outline-offset: 2px;
}

.mpg-card-portrait {
  width: 132px;
  max-width: 100%;
  pointer-events: none;
}

.mpg-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: var(--gold, #d8b476);
  background: radial-gradient(circle at 50% 35%, #34232d, #131217 85%);
}

.mpg-placeholder-crest {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  opacity: 0.72;
}

.mpg-placeholder-initial {
  font-family: Georgia, serif;
  font-size: 40px;
  line-height: 1;
  color: #f1d49b;
  text-shadow: 0 2px 10px #000a;
}

.mpg-lock-badge {
  position: absolute;
  bottom: 7px;
  right: 7px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #141218dd;
  border: 1px solid #b58d52;
  color: var(--gold, #d8b476);
  box-shadow: 0 2px 8px #0009;
}

.mpg-lock-badge svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.mpg-card-name {
  display: block;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.3;
  color: var(--gold, #d8b476);
  overflow-wrap: anywhere;
}

.mpg-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted, #b6b0a6);
}

/* Switch PG + Special Tools (Session Mode / Internal Search) in nav */
#mpg-switch-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px 11px;
  margin-bottom: 10px;
  border: 1px solid #6b5842;
  border-radius: 7px;
  background: linear-gradient(155deg, #241c21, #151419);
}

#mpg-switch-nav .mpg-active-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted, #b6b0a6);
}

#mpg-switch-nav .mpg-active-name {
  display: block;
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--gold, #d8b476);
  overflow-wrap: anywhere;
}

#mpg-switch-nav .mpg-switch-btn,
.mpg-nav-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #8a6e48;
  color: #f3dcaf;
  background: linear-gradient(155deg, #322126, #1b171d);
  cursor: pointer;
}

.mpg-nav-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.mpg-nav-tool-btn.is-active {
  border-color: #f0cf8e;
  background: linear-gradient(155deg, #5c2730, #2e1920);
  color: #fff6e2;
  box-shadow: 0 0 0 1px #f0cf8e44;
}

#mpg-switch-nav .mpg-switch-btn:hover,
#mpg-switch-nav .mpg-switch-btn:focus-visible,
.mpg-nav-tool-btn:hover,
.mpg-nav-tool-btn:focus-visible {
  background: #522d34;
  border-color: var(--gold, #d8b476);
  color: #fff6e2;
}

#mpg-switch-nav .mpg-switch-btn svg,
.mpg-nav-tool-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  flex-shrink: 0;
}

/* Dialogs & Full Backup Preview (Fase 2) */
.mpg-dialog {
  max-width: 480px;
}

.mpg-dialog h2 {
  margin-top: 0;
  color: var(--gold, #d8b476);
}

.mpg-dialog form > label {
  margin-bottom: 12px;
}

.mpg-backup-section {
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #5e503e;
  border-radius: 9px;
  background: #151419;
}

.mpg-backup-section h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--gold, #d8b476);
}

.mpg-backup-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.mpg-backup-stat {
  padding: 8px 10px;
  border: 1px solid #4e4234;
  border-radius: 7px;
  background: #1b181f;
}

.mpg-backup-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #b6b0a6;
}

.mpg-backup-stat strong {
  font-family: Georgia, serif;
  font-size: 15px;
  color: #f6e7c8;
}

.mpg-backup-preview {
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px solid #8a6e48;
  border-radius: 8px;
  background: linear-gradient(155deg, #221b20, #141318);
}

.mpg-backup-preview h4 {
  margin: 0 0 8px;
  color: #f6e7c8;
}

.mpg-mode-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
}

.mpg-mode-option {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid #5e503e;
  border-radius: 8px;
  background: #18161c;
  color: #ede9e2 !important;
  cursor: pointer;
}

.mpg-mode-option input[type="radio"] {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--gold, #d8b476);
}

.mpg-mode-option strong {
  display: block;
  color: #f6e7c8;
}

.mpg-mode-option small {
  display: block;
  margin-top: 2px;
  color: #c4bab0;
  line-height: 1.4;
}

.mpg-pw-box {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #5e503e;
  border-radius: 7px;
  background: #151419;
}

.mpg-pw-toggle {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 0 !important;
  color: var(--ink, #ede9e2) !important;
  cursor: pointer;
}

.mpg-pw-fields {
  margin-top: 10px;
}

.mpg-pw-fields[hidden] {
  display: none !important;
}

.mpg-form-error {
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #b74a4a;
  background: #471d22;
  color: #ffd7d7;
  font-size: 13px;
}

.mpg-form-error[hidden] {
  display: none !important;
}

.mpg-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mpg-manage-dialog {
  max-width: 520px;
}

.mpg-manage-pg-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid #6b5842;
  border-radius: 8px;
  background: linear-gradient(155deg, #241c21, #151419);
}

.mpg-manage-pg-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--muted, #b6b0a6);
}

.mpg-manage-pg-header strong {
  font-family: Georgia, serif;
  font-size: 18px;
  color: var(--gold, #d8b476);
  overflow-wrap: anywhere;
}

.mpg-manage-section {
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #5e503e;
  border-radius: 8px;
  background: #151419;
}

.mpg-manage-section h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--gold, #d8b476);
}

.mpg-subform h4 {
  margin: 10px 0 8px;
  font-size: 14px;
  color: #f3dcaf;
}

.mpg-subform label {
  display: block;
  margin-bottom: 9px;
}

.mpg-subform-sep {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #453a2f;
}

.mpg-manage-danger-zone {
  padding: 12px 14px;
  border: 1px solid #8a353b;
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(61, 21, 26, 0.48), rgba(24, 14, 17, 0.72));
}

.mpg-manage-danger-zone h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #ffb8b8;
}

.mpg-danger-outline-btn {
  margin-top: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #cc4d54;
  border-radius: 7px;
  background: linear-gradient(155deg, #5c1e24, #371317);
  color: #ffe2e2;
  font-weight: 600;
  cursor: pointer;
}

.mpg-danger-outline-btn:hover,
.mpg-danger-outline-btn:focus-visible {
  border-color: #ff7c82;
  background: linear-gradient(155deg, #79272f, #4b181d);
  color: #fff;
}

/* Mandatory Double-Confirmation Delete Dialog */
.mpg-delete-dialog {
  width: min(500px, calc(100vw - 24px));
  padding: 0;
  border: 2px solid #c9464d;
  border-radius: 12px;
  background: linear-gradient(160deg, #251317, #130e11);
  color: #f4ece8;
  box-shadow: 0 22px 60px #000c, 0 0 0 1px #ff787833;
}

.mpg-delete-dialog::backdrop {
  background: rgba(6, 4, 6, 0.82);
  backdrop-filter: blur(2px);
}

.mpg-delete-box {
  padding: 20px 20px 18px;
}

.mpg-delete-title {
  margin: 0 0 12px;
  font-family: Georgia, serif;
  font-size: 21px;
  color: #ffc7c7;
}

.mpg-danger-banner {
  padding: 13px 14px;
  margin-bottom: 14px;
  border: 1px solid #c5484f;
  border-left: 5px solid #e2535a;
  border-radius: 8px;
  background: rgba(110, 22, 30, 0.45);
  color: #ffe3e3;
  font-size: 14px;
  line-height: 1.55;
}

.mpg-danger-banner p {
  margin: 0;
}

.mpg-danger-banner-strong {
  border-color: #e4555d;
  border-left-width: 6px;
  background: rgba(134, 24, 33, 0.56);
  color: #fff0f0;
}

.mpg-delete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.mpg-cancel-btn {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #8a7558;
  border-radius: 7px;
  background: #231f24;
  color: #f3ead9;
  cursor: pointer;
}

.mpg-cancel-btn:hover,
.mpg-cancel-btn:focus-visible {
  border-color: var(--gold, #d8b476);
  background: #302930;
}

.mpg-danger-btn {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #df575e;
  border-radius: 7px;
  background: linear-gradient(155deg, #9d242d, #68161d);
  color: #fff4f4;
  font-weight: 700;
  cursor: pointer;
}

.mpg-danger-btn:hover,
.mpg-danger-btn:focus-visible {
  border-color: #ff8c91;
  background: linear-gradient(155deg, #bb2c37, #811a23);
  color: #ffffff;
}

.mpg-danger-btn-final {
  border-color: #ff6b72;
  background: linear-gradient(155deg, #b8212c, #7b141c);
  box-shadow: 0 4px 16px #b8212c55;
}

.mpg-danger-btn-final:hover,
.mpg-danger-btn-final:focus-visible {
  border-color: #ffa2a6;
  background: linear-gradient(155deg, #d12835, #941923);
}

.mpg-danger-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Concentrazione active state */
#livepanel .livebox-conc {
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#livepanel .livebox-conc.is-conc-active {
  background: linear-gradient(150deg, #4f2331, #2e1823 70%, #20161c);
  border-color: #d8a85f;
  box-shadow: 0 0 0 1px #d8b47644, 0 6px 18px #6e282d55;
}

#livepanel .livebox-conc.is-conc-active h3 {
  color: #f6dc9f;
}

#livepanel .livebox-conc.is-conc-active > div {
  color: #fff6ea;
  font-weight: 600;
}

/* Anime intrecciate: same decorative vertical 3:4 portrait frame as header */
#content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  align-items: start;
}

#content .gallery > article.card.soul-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

#content .gallery > article.card.soul-card:has(details) {
  padding: 0;
}

#content .gallery > article.card.soul-card:has(details[open]) {
  grid-column: 1 / -1;
}

.soul-card-layout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.soul-card-layout.soul-body-no-portrait {
  grid-template-columns: minmax(0, 1fr);
}

#content .gallery details > .soul-card-layout.soul-body-no-portrait {
  padding: 18px;
}

.soul-portrait-frame {
  width: 112px;
}

.soul-portrait-frame .header-portrait-placeholder {
  gap: 4px;
  padding: 6px;
}

.soul-portrait-frame .header-portrait-placeholder svg {
  width: 30px;
  height: 30px;
}

.soul-portrait-frame .header-portrait-placeholder span {
  font-size: 9px;
  letter-spacing: 0.9px;
}

.soul-card-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.soul-card-info h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.soul-card-info .meta {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.soul-card-info .prose {
  margin: 0;
  overflow-wrap: anywhere;
}

.soul-card-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.soul-portrait-editor {
  margin: 14px 0;
}

#content .gallery summary.soul-summary-with-portrait,
#content .gallery .v711-summary.soul-summary-with-portrait,
#content .gallery .v711-head.soul-summary-with-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 20px 16px 18px;
  cursor: pointer;
  list-style: none;
}

#content .gallery details[open] > summary.soul-summary-with-portrait {
  border-bottom: 1px solid #6b5741;
}

#content .gallery summary.soul-summary-with-portrait::-webkit-details-marker {
  display: none;
}

#content .gallery summary.soul-summary-with-portrait::after,
#content .gallery details[open] > summary.soul-summary-with-portrait::after {
  content: none;
  display: none;
}

#content .gallery summary.soul-summary-with-portrait:hover {
  background: #8d5b4522;
}

#content .gallery summary.soul-summary-with-portrait:focus-visible {
  outline: 2px solid var(--gold, #d8b476);
  outline-offset: -3px;
}

.soul-summary-title {
  margin: 0;
  font: 700 20px/1.25 Georgia, serif;
  color: var(--gold, #d8b476);
  overflow-wrap: anywhere;
  max-width: 100%;
}

.soul-summary-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.soul-summary-portrait .soul-portrait-frame {
  width: 124px;
  margin: 0 auto;
}

.soul-summary-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.soul-summary-info .meta,
.soul-summary-role {
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #ddd4dc;
  overflow-wrap: anywhere;
}

.soul-summary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 230px;
  min-height: 40px;
  margin: 4px auto 0;
  padding: 9px 18px;
  border: 1px solid #c69f61;
  border-radius: 6px;
  background: linear-gradient(160deg, #3c252c, #22181d);
  color: #f8e5be;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

summary.soul-summary-with-portrait:hover .soul-summary-action,
summary.soul-summary-with-portrait:focus-visible .soul-summary-action {
  border-color: #f0cf8e;
  background: linear-gradient(160deg, #523039, #2e1f26);
  color: #fff3da;
}

.soul-summary-action.is-open {
  background: linear-gradient(160deg, #2b2328, #19171d);
  border-color: #8f7754;
  color: #ead8b5;
}

/* Header background preview in editors */
.header-bg-editor {
  margin: 14px 0 10px;
  padding: 14px;
  border: 1px solid #675845;
  border-radius: 7px;
  background: #16141a99;
}

.header-bg-editor h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--gold, #d8b476);
}

.header-bg-controls {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.header-bg-preview-frame {
  position: relative;
  width: 180px;
  aspect-ratio: 16 / 7;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #8c7049;
  background: linear-gradient(90deg, #101013ee, #18101955), url('assets/cavern.svg') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.header-bg-preview-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(14, 13, 18, 0.36), rgba(20, 14, 22, 0.22));
  pointer-events: none;
}

.header-bg-preview-frame.is-empty::after {
  display: none;
}

.header-bg-preview-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f3ead9;
  text-shadow: 0 1px 5px #000, 0 0 8px rgba(0, 0, 0, 0.85);
}

.mpg-sr-file {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.mpg-tools-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #60513e;
}

.mpg-tools-section h3 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--gold, #d8b476);
}

/* Campaign Badges shared between Home PG cards and PG <header> */
.mpg-card-campaigns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #44382c;
}

.mpg-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.mpg-camp-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid #7d6748;
  background: linear-gradient(155deg, #271f24, #151419);
  color: var(--gold, #d8b476);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.mpg-camp-badge:hover,
.mpg-camp-badge:focus-visible,
.mpg-camp-badge[aria-expanded="true"] {
  border-color: #f0cf8e;
  background: linear-gradient(155deg, #3e2830, #20181d);
  color: #fff3da;
  transform: translateY(-1px);
}

.mpg-camp-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
}

.mpg-camp-badge-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mpg-camp-status-dot,
.mpg-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mpg-camp-badge .mpg-camp-status-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #131116;
}

.mpg-camp-badge.is-in-progress .mpg-camp-status-dot,
.mpg-status-dot.is-in-progress,
.mpg-status-badge.is-in-progress .mpg-status-dot {
  background: #f3c64f;
  box-shadow: 0 0 6px rgba(243, 198, 79, 0.7);
}

.mpg-camp-badge.is-completed .mpg-camp-status-dot,
.mpg-status-dot.is-completed,
.mpg-status-badge.is-completed .mpg-status-dot {
  background: #57c97a;
  box-shadow: 0 0 6px rgba(87, 201, 122, 0.7);
}

.mpg-badge-detail-status {
  color: #cbbfa9;
}

/* Ornamental Divider & Campaigns Section on Start Screen */
.mpg-section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 34px 0 30px;
}

.mpg-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #8e6f46 35%, #8e6f46 65%, transparent);
  opacity: 0.75;
}

.mpg-divider-ornament {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--gold, #d8b476);
  stroke-width: 1.6;
  opacity: 0.9;
}

.mpg-campaigns-section {
  margin-top: 4px;
}

.mpg-campaigns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.mpg-campaigns-header h2 {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 1.4px;
  color: var(--gold, #d8b476);
}

.mpg-campaign-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mpg-campaign-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 58px 20px 22px;
  border: 1px solid var(--border, #79694e);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(31, 24, 29, 0.96), rgba(16, 16, 20, 0.98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}

.mpg-campaign-card.has-custom-bg {
  background-color: #141218;
}

.mpg-campaign-card.has-custom-bg .mpg-campaign-title,
.mpg-campaign-card.has-custom-bg .mpg-campaign-subtitle,
.mpg-campaign-card.has-custom-bg .mpg-campaign-desc,
.mpg-campaign-card.has-custom-bg .mpg-campaign-part-label {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.94), 0 1px 2px rgba(0, 0, 0, 0.96);
}

.mpg-campaign-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.mpg-campaign-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid #96774c;
  background: linear-gradient(155deg, #312329, #18151b);
  color: var(--gold, #d8b476);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.mpg-campaign-emblem svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mpg-campaign-heading {
  min-width: 0;
  flex: 1;
}

/* Fase 1B: Campaign footer placing participants on left & status badge on bottom-right */
.mpg-campaign-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(121, 105, 78, 0.42);
}

.mpg-campaign-participants {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.mpg-campaign-status-corner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-shrink: 0;
}

.mpg-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
}

.mpg-status-badge.is-in-progress {
  color: #fce49a;
  background: rgba(62, 45, 16, 0.88);
  border-color: rgba(243, 198, 79, 0.65);
}

.mpg-status-badge.is-completed {
  color: #c5f7d2;
  background: rgba(18, 52, 30, 0.88);
  border-color: rgba(87, 201, 122, 0.65);
}

.mpg-campaign-title {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.25;
  color: #f6e7c8;
  overflow-wrap: anywhere;
}

.mpg-campaign-subtitle {
  margin: 0;
  font-size: 14px;
  color: #d8c6aa;
  overflow-wrap: anywhere;
}

.mpg-campaign-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  color: #e2dadf;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.mpg-campaign-part-label {
  font-size: 11px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #cfc1aa;
}

.mpg-campaign-part-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mpg-participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border-radius: 7px;
  border: 1px solid #6b5842;
  background: rgba(20, 17, 23, 0.88);
  color: #efe5d2;
  font-size: 13px;
}

.mpg-participant-avatar,
.mpg-pg-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #9c7b4d;
  background: #241c23;
  color: var(--gold, #d8b476);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.mpg-participant-avatar img,
.mpg-pg-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mpg-campaign-no-pgs {
  font-size: 13px;
  color: var(--muted, #b6b0a6);
  font-style: italic;
}

/* Campaign & Home Header Modals */
.mpg-wide-dialog {
  max-width: 680px;
}

.mpg-field-block {
  margin: 14px 0;
}

.mpg-field-title {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--gold, #d8b476);
}

.mpg-icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.mpg-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid #5e503e;
  background: #16141a;
  color: #d6c8b2;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.mpg-icon-option:hover,
.mpg-icon-option:focus-visible {
  border-color: #b58d52;
  background: #241d23;
  color: #fff2d6;
}

.mpg-icon-option.is-selected {
  border-color: #f0cf8e;
  background: linear-gradient(155deg, #4b2831, #26191f);
  color: #ffe8ba;
  box-shadow: 0 0 0 1px #f0cf8e55, 0 4px 12px rgba(0, 0, 0, 0.45);
}

.mpg-icon-svg svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mpg-icon-label {
  font-size: 12px;
  line-height: 1.25;
}

.mpg-status-select-label {
  display: block;
}

.mpg-status-select-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.mpg-status-select-row select {
  flex: 1;
  min-width: 170px;
  margin: 0;
}

.mpg-pg-multiselect {
  border: 1px solid #5e503e;
  border-radius: 8px;
  background: #151419;
  padding: 0;
}

.mpg-pg-multiselect > summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #efe5d2;
  user-select: none;
}

.mpg-pg-multiselect[open] > summary {
  border-bottom: 1px solid #483c2f;
}

.mpg-pg-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
}

.mpg-pg-check-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 0 !important;
  border-radius: 6px;
  cursor: pointer;
  color: #ede9e2 !important;
}

.mpg-pg-check-item:hover {
  background: rgba(141, 91, 69, 0.22);
}

.mpg-pg-check-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--gold, #d8b476);
}

.mpg-pg-check-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mpg-pg-check-lock {
  font-size: 11px;
  color: var(--gold, #d8b476);
}

.mpg-pg-check-empty {
  margin: 4px 6px;
}

.mpg-selected-pg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mpg-selected-pg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #7d6748;
  background: #231c21;
  color: #f4e7cd;
  font-size: 12px;
}

.mpg-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #e8b384;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.mpg-chip-remove:hover,
.mpg-chip-remove:focus-visible {
  background: rgba(201, 70, 77, 0.3);
  color: #fff;
}

.mpg-campaign-danger-zone {
  margin-top: 16px;
}

/* Favorite toggle on Spells / Abilities / Actions cards */
.mpg-entry-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mpg-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid #6e5a42;
  background: #1a171d;
  color: #9f9689;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.mpg-fav-btn.is-fav {
  border-color: #d8a85f;
  background: linear-gradient(155deg, #4b2d22, #291a16);
  color: #f8d88a;
}

.mpg-fav-btn:hover,
.mpg-fav-btn:focus-visible {
  border-color: #f0cf8e;
  color: #fff2cc;
}

/* Special Views (Fase 6 Modalità sessione & Fase 7 Cerca nel PG) */
.mpg-special-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.mpg-special-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.mpg-special-head h2 {
  margin: 0;
}

.mpg-panel-card {
  padding: 16px;
  border: 1px solid var(--border, #79694e);
  border-radius: 10px;
  background: linear-gradient(155deg, rgba(28, 22, 26, 0.94), rgba(16, 16, 20, 0.96));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}

.mpg-panel-card h3 {
  margin: 0 0 10px;
  font-family: Georgia, serif;
  color: var(--gold, #d8b476);
}

.mpg-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.mpg-session-card-full {
  grid-column: 1 / -1;
}

.mpg-session-conc-active {
  border-color: #d8a85f;
  background: linear-gradient(150deg, #47212d, #24161c);
}

.mpg-session-res-row,
.mpg-session-fav-row,
.mpg-session-cond-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #483b2f;
  border-radius: 7px;
  background: #141318;
  margin-bottom: 8px;
}

.mpg-session-res-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mpg-session-res-controls button {
  min-width: 36px;
  min-height: 36px;
}

.mpg-session-notes {
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.mpg-search-result-card {
  padding: 14px 16px;
  border: 1px solid #6b5842;
  border-radius: 9px;
  background: linear-gradient(155deg, #211b20, #151418);
}

.mpg-search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.mpg-search-kind {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #8a6e48;
  background: #271f24;
  color: #f3dcaf;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mpg-search-snippet {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #dad0db;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  body.mpg-home-active {
    padding-top: 0 !important;
  }

  #mpg-home-screen {
    padding: 16px 12px 38px;
  }

  .mpg-hero {
    padding: 18px 46px 16px 14px;
    margin-bottom: 16px;
  }

  .mpg-hero h1 {
    font-size: clamp(21px, 6vw, 28px);
    margin-bottom: 6px;
  }

  .mpg-hero-edit,
  .mpg-campaign-edit {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }

  .mpg-archive-bar {
    padding: 10px 12px;
  }

  .mpg-filter-bar,
  .mpg-filter-bar-campaigns {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 10px 12px;
  }

  .mpg-campaign-card {
    padding: 18px 46px 16px 14px;
  }

  .mpg-campaign-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mpg-campaign-status-corner {
    justify-content: flex-end;
  }

  .mpg-campaign-top {
    gap: 12px;
  }

  .mpg-campaign-emblem {
    width: 44px;
    height: 44px;
  }

  .mpg-campaign-emblem svg {
    width: 24px;
    height: 24px;
  }

  .mpg-icon-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mpg-grid {
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    gap: 12px;
  }

  .mpg-card-wrap {
    padding: 8px 9px 13px;
  }

  .mpg-card-head {
    min-height: 32px;
  }

  .mpg-card-edit {
    width: 32px;
    height: 32px;
  }

  .mpg-card {
    padding: 2px 2px 0;
    gap: 10px;
  }

  .mpg-card-portrait {
    width: 104px;
  }

  .mpg-placeholder-initial {
    font-size: 32px;
  }

  .mpg-card-name {
    font-size: 15px;
  }

  #mpg-switch-nav {
    padding: 8px 9px;
    margin-bottom: 6px;
  }

  .mpg-nav-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #content .gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .soul-card-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .soul-card-layout .soul-portrait-frame {
    width: 112px;
    margin: 0 auto;
  }

  #content .gallery summary.soul-summary-with-portrait,
  #content .gallery .v711-summary.soul-summary-with-portrait,
  #content .gallery .v711-head.soul-summary-with-portrait {
    padding: 18px 14px 16px;
    gap: 11px;
  }

  .soul-summary-title {
    font-size: 19px;
  }

  .soul-summary-portrait .soul-portrait-frame {
    width: 112px;
  }

  .soul-summary-action {
    max-width: 100%;
    min-height: 42px;
    font-size: 14px;
  }

  .header-bg-controls {
    grid-template-columns: 1fr;
  }

  .header-bg-preview-frame {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
  }

  .mpg-session-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  #mpg-home-screen,
  #mpg-switch-nav,
  .mpg-dialog,
  #mpg-delete-dialog,
  .soul-summary-action {
    display: none !important;
  }

  .soul-card-layout {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .soul-card-layout.soul-body-no-portrait {
    grid-template-columns: minmax(0, 1fr);
  }
}
