* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

:root {
  --ink: #152033;
  --muted: #5b6c80;
  --line: #dce6f1;
  --soft: #f6f9fd;
  --blue: #075fd6;
  --green: #087a3d;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #ffffff;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.58;
}

a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  border-bottom: 1px solid #0047cc;
  background: #0047cc;
}

.topbar-inner,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  color: #ffffff;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.35px;
}

.brand:hover {
  color: #ffffff;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
}

.nav a {
  color: #ffffff;
  font-weight: 500;
}

.nav a:hover {
  color: #bfdbfe;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  background: rgba(255, 255, 255, .08);
  padding: 0;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .48);
}

.menu-toggle span {
  width: 16px;
  height: 1.4px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform .2s ease, opacity .2s ease;
}

.topbar-inner.nav-open .menu-toggle span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.topbar-inner.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar-inner.nav-open .menu-toggle span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  padding: 70px 22px 28px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 500;
  padding: 12px 0;
}

.mobile-nav a:hover {
  color: var(--blue);
  text-decoration: none;
}

.mobile-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #334966;
  font-size: 0;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.mobile-close::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, transparent 46%, currentColor 47% 53%, transparent 54%), linear-gradient(-45deg, transparent 46%, currentColor 47% 53%, transparent 54%);
}

.edit-open {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  min-height: 34px;
  border: 1px solid #061f49;
  border-radius: 6px;
  background: #0b3470;
  box-shadow: 0 8px 22px rgba(8, 22, 45, .2);
  color: #ffffff;
  cursor: pointer;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.edit-open:hover {
  background: #092b5d;
}

.edit-open:focus-visible {
  outline: 3px solid rgba(7, 95, 214, .22);
  outline-offset: 3px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 28px;
  align-items: center;
  padding: 36px 0 28px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
}

.hero-copy p {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-media {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: url("journal-banner-placeholder.svg");
  background-color: var(--soft);
  background-position: center;
  background-size: cover;
}

.meta-grid,
.content-grid,
.reason-grid {
  display: grid;
  gap: 14px;
}

.meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 4px 0 24px;
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  align-items: start;
}

.reason-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.card {
  padding: 14px;
}

.card b,
.panel h2,
.panel h3 {
  font-weight: 500;
}

.card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.intro-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d5e4f6;
  border-radius: 8px;
  background: #f7fbff;
  margin: 2px 0 22px;
  padding: 18px;
}

.intro-band h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.intro-band p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

.journal-directory {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.journal-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(11, 52, 112, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.journal-item:hover {
  transform: translateY(-2px);
  border-color: #7eace8;
  background: #f8fbff;
  box-shadow: 0 14px 34px rgba(11, 52, 112, .14);
  text-decoration: none;
}

.journal-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.journal-copy b {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.journal-copy span {
  color: var(--muted);
  font-size: 13px;
}

.journal-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 12px;
  color: #0b3470;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.journal-item:hover .journal-action {
  border-color: #0b3470;
  background: #0b3470;
  color: #ffffff;
}

.panel {
  margin-bottom: 14px;
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.panel h2 {
  font-size: 23px;
}

.panel h3 {
  font-size: 18px;
}

.panel p,
.panel li {
  color: var(--muted);
}

.panel p {
  margin: 0 0 10px;
}

ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

li {
  margin: 6px 0;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  background: #f7fbff;
  padding: 4px 9px;
  color: #30557f;
  font-size: 12px;
  font-weight: 500;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: var(--blue);
  padding: 9px 14px;
  color: #ffffff;
}

.cta:hover {
  color: #ffffff;
  text-decoration: none;
}

.secondary-cta {
  margin-top: 12px;
}

footer {
  margin-top: 24px;
  background: #0f172a;
  padding: 18px;
  color: #cbd5e1;
  font-size: 13px;
  border-radius: 8px 8px 0 0;
}

.is-editing {
  overflow: hidden;
}

.is-editing .edit-open {
  display: none;
}

.edit-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 50;
  overflow: hidden;
  background: rgba(8, 22, 45, .62);
  padding: 24px 12px;
}

.edit-modal,
body:not(.is-editing) .edit-modal {
  display: none;
}

.is-editing .edit-modal {
  display: flex;
}

.edit-modal[hidden] {
  display: none;
}

.edit-dialog {
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  min-width: 0;
  margin: 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d9e4f2;
  box-shadow: 0 22px 70px rgba(8, 22, 45, .28);
  overflow: hidden;
}

.edit-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
  padding: 14px 18px;
}

.edit-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

#npsInfoEditForm {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 16px;
}

.edit-body {
  display: grid;
  gap: 12px;
}

.edit-section {
  min-width: 0;
  border: 1px solid #e1eaf5;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.edit-section h3 {
  margin: 0 0 12px;
  color: #0b3470;
  font-size: 15px;
  font-weight: 500;
}

.edit-fields,
.section-editor {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.edit-fields-two {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.edit-fields-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-editor {
  grid-template-columns: minmax(190px, .42fr) minmax(0, 1fr);
}

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  color: #334b66;
  font-size: 12px;
  font-weight: 500;
}

.field span {
  line-height: 1.25;
}

.field input,
.field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #cfdbeb;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
}

.field input {
  height: 36px;
}

.field input:focus,
.field textarea:focus {
  border-color: #7eace8;
  box-shadow: 0 0 0 3px rgba(7, 95, 214, .1);
  outline: 0;
}

.field textarea {
  min-height: 84px;
  line-height: 1.45;
  resize: vertical;
}

.section-editor .field:not(.field-textarea) {
  align-self: start;
}

.image-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  border: 1px dashed #bad3f1;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  min-width: 0;
}

.image-upload {
  min-width: 0;
}

.file-control {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #cfdbeb;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-select {
  flex: 0 0 auto;
  border-right: 1px solid #cfdbeb;
  background: #f8fbff;
  color: #0b3470;
  cursor: pointer;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
}

.file-select:hover {
  background: #eef6ff;
}

.file-control:focus-within {
  border-color: #7eace8;
  box-shadow: 0 0 0 3px rgba(7, 95, 214, .1);
}

.file-name {
  min-width: 0;
  overflow: hidden;
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-editor p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.image-dimensions {
  line-height: 1.45;
}

.image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  min-width: 0;
}

.image-actions a {
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.secondary-button,
.save-button {
  border-radius: 6px;
  cursor: pointer;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.danger-button {
  color: #9f2d20;
}

.save-button {
  border: 0;
  background: #0b3470;
  color: #ffffff;
}

.save-button:hover {
  background: #092b5d;
}

.save-button:disabled {
  cursor: wait;
  opacity: .72;
}

.edit-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 13px;
}

.edit-status.is-error {
  color: #b42318;
}

.edit-actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin: 14px -16px -16px;
  background: #fbfdff;
  padding: 14px 16px;
}

@media (max-width: 980px) {
  .edit-fields-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .topbar-inner,
  main {
    width: min(100% - 28px, 1120px);
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    display: flex;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 10px 0;
    gap: 10px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    width: 100%;
    margin-top: 0;
    gap: 3px;
    padding: 6px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: .9rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
  }

  .topbar-inner.nav-open .nav {
    display: grid;
    opacity: 1;
    transform: none;
  }

  .nav a {
    padding: 9px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    border-radius: 0;
    font-weight: 500;
  }

  .nav a:hover {
    background: transparent;
  }

  footer {
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.4;
  }

  .edit-fields-two,
  .edit-fields-four,
  .section-editor,
  .image-editor {
    grid-template-columns: 1fr;
  }

  .image-actions,
  .edit-actions {
    justify-content: stretch;
  }

  .image-actions > *,
  .edit-actions > * {
    flex: 1;
    text-align: center;
  }

  .meta-grid,
  .reason-grid,
  .intro-band {
    grid-template-columns: 1fr;
  }

  .intro-band {
    display: grid;
  }

  .hero {
    gap: 16px;
    padding: 22px 0 18px;
  }

  .hero-copy h1 {
    font-size: 28px;
  }

  .hero-copy p {
    margin-top: 8px;
    font-size: 14px;
  }

  .hero-media {
    min-height: 170px;
  }

  .panel,
  .card,
  .journal-item,
  .intro-band {
    border-radius: 8px;
  }

  .panel,
  .intro-band {
    padding: 16px;
  }

  .journal-item {
    grid-template-columns: 1fr;
  }

  .journal-action {
    justify-self: start;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-media {
    min-height: 190px;
  }

  .edit-open {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-height: 640px) {
  .edit-modal {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .edit-dialog {
    max-height: calc(100dvh - 20px);
  }
}
