*,
*::before,
*::after {
  box-sizing: border-box;
}

body.pub-body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #1a1a1a;
  background: #f7f5f1;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pub-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.pub-header {
  background: #fff;
  border-bottom: 1px solid #ddd8ce;
}

.pub-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.05rem;
}

.pub-brand img {
  height: 36px;
  width: auto;
  display: block;
}

.pub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.pub-nav a {
  text-decoration: none;
  color: #444;
  font-size: 0.95rem;
  font-family: Arial, Helvetica, sans-serif;
}

.pub-nav a:hover,
.pub-nav a.is-active {
  color: #0b5f4b;
}

.pub-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.pub-footer {
  border-top: 1px solid #ddd8ce;
  background: #fff;
  padding: 1rem 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  color: #666;
}

.pub-footer p {
  margin: 0;
}

.pub-hero {
  padding: 1.5rem 0 0.5rem;
}

.pub-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #14241f;
}

.pub-hero p {
  margin: 0 0 1.25rem;
  max-width: 36rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  color: #444;
}

.pub-btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  background: #0b5f4b;
  color: #fff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  border-radius: 4px;
}

.pub-btn:hover {
  background: #094c3c;
}

.pub-btn-outline {
  background: #fff;
  color: #0b5f4b;
  border: 1px solid #0b5f4b;
}

.pub-btn-outline:hover {
  background: #e8f2ee;
}

.pub-btn-light {
  background: #ece8e0;
  color: #14241f;
}

.pub-btn-light:hover {
  background: #e0dbd1;
}

.pub-buy-wrap {
  margin-top: 1rem;
}

.pub-enrolled-label {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  color: #0b5f4b;
  background: #e8f2ee;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
}

.pub-nav-user {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  color: #666;
}

body.pub-modal-open {
  overflow: hidden;
}

.pub-modal[hidden] {
  display: none !important;
}

.pub-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 31, 0.45);
}

.pub-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #ddd8ce;
  border-radius: 10px;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 16px 40px rgba(20, 36, 31, 0.16);
}

.pub-modal-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #14241f;
}

.pub-modal-text {
  margin: 0 0 1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  color: #555;
}

.pub-modal-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: #777;
  cursor: pointer;
}

.pub-modal-field {
  margin-bottom: 0.85rem;
  font-family: Arial, Helvetica, sans-serif;
}

.pub-modal-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.pub-modal-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc5b8;
  border-radius: 6px;
  font-size: 0.95rem;
}

.pub-modal-field input:focus {
  outline: none;
  border-color: #0b5f4b;
  box-shadow: 0 0 0 3px rgba(11, 95, 75, 0.12);
}

.pub-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.pub-modal-error,
.pub-modal-success {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

.pub-modal-error {
  background: #fdecec;
  border: 1px solid #f3c1c1;
  color: #8a1f1f;
}

.pub-modal-success {
  background: #e8f2ee;
  border: 1px solid #b7d9cb;
  color: #0b5f4b;
}

.pub-password-reveal {
  margin-top: 0.35rem;
  padding: 0.9rem 0.95rem;
  border-radius: 10px;
  background: #f3faf7;
  border: 1px solid #cfe5db;
}

.pub-password-reveal-title {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #10231c;
}

.pub-password-reveal-note {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: #5b6b64;
  line-height: 1.4;
}

.pub-password-reveal-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.pub-password-reveal-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pub-password-reveal-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #b7d5cb;
  border-radius: 8px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #10231c;
  letter-spacing: 0.02em;
}

.pub-password-reveal-row .pub-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.pub-password-copy-status {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #0b5f4b;
  font-weight: 600;
}

.pub-password-reveal .pub-modal-actions {
  margin-top: 0.95rem;
}

.pub-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd8ce;
}

.pub-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.pub-section p {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #555;
  max-width: 40rem;
}

.pub-filters {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #ddd8ce;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
}

.pub-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-end;
}

.pub-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 180px;
  flex: 1;
}

.pub-filter-field label {
  font-size: 0.8rem;
  color: #666;
}

.pub-filter-field select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #ccc5b8;
  border-radius: 4px;
  background: #fff;
  font-size: 0.92rem;
  color: #222;
}

.pub-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.1rem;
}

.pub-link-reset {
  color: #0b5f4b;
  text-decoration: none;
  font-size: 0.9rem;
}

.pub-link-reset:hover {
  text-decoration: underline;
}

.pub-empty {
  margin: 1.5rem 0 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #666;
}

.pub-empty-spaced {
  margin-top: 1rem;
}

.pub-checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.1rem;
  margin-top: 0.5rem;
  align-items: start;
}

.pub-checkout-card {
  background: #fff;
  border: 1px solid #ddd8ce;
  border-radius: 10px;
  padding: 1.1rem 1.15rem 1.2rem;
}

.pub-checkout-card h2 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
  color: #14241f;
}

.pub-checkout-course {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.9rem;
  align-items: start;
}

.pub-checkout-course img {
  width: 110px;
  height: 78px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e4dfd4;
}

.pub-checkout-course h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.pub-checkout-validity {
  margin: 0.35rem 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  color: #555;
}

.pub-checkout-summary {
  margin: 0;
}

.pub-checkout-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0ebe3;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
}

.pub-checkout-summary dt,
.pub-checkout-summary dd {
  margin: 0;
}

.pub-checkout-summary dt {
  color: #666;
}

.pub-checkout-summary dd {
  color: #14241f;
  font-weight: 600;
}

.pub-checkout-total {
  border-bottom: 0 !important;
  margin-top: 0.25rem;
  padding-top: 0.7rem !important;
}

.pub-checkout-total dt,
.pub-checkout-total dd {
  font-size: 1.05rem;
  color: #0b5f4b !important;
}

.pub-checkout-buyer {
  margin: 1rem 0;
  padding: 0.7rem 0.8rem;
  background: #faf9f6;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  color: #444;
}

.pub-checkout-buyer span {
  color: #777;
  margin-right: 0.35rem;
}

.pub-checkout-phone-field {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.pub-checkout-hint {
  display: block;
  margin-top: 0.3rem;
  color: #777;
  font-size: 0.78rem;
}

@media (max-width: 800px) {
  .pub-checkout-grid {
    grid-template-columns: 1fr;
  }

  .pub-checkout-course {
    grid-template-columns: 90px 1fr;
  }
}

.pub-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pub-course-card {
  background: #fff;
  border: 1px solid #ddd8ce;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pub-course-media {
  display: block;
  background: #ece8e0;
}

.pub-course-media img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.pub-course-placeholder {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  color: #888;
  font-size: 0.9rem;
}

.pub-course-body {
  padding: 0.9rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.pub-course-meta {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  color: #777;
}

.pub-course-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.pub-course-title a {
  color: #14241f;
  text-decoration: none;
}

.pub-course-title a:hover {
  color: #0b5f4b;
}

.pub-course-info {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  color: #333;
  margin: 0.2rem 0 0.35rem;
}

.pub-btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  align-self: flex-start;
  margin-top: auto;
}

.pub-breadcrumb {
  margin: 0 0 1.25rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  color: #777;
}

.pub-breadcrumb a {
  color: #0b5f4b;
  text-decoration: none;
}

.pub-breadcrumb span {
  margin: 0 0.35rem;
}

.pub-detail-hero {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

.pub-detail-media {
  background: #ece8e0;
  border: 1px solid #ddd8ce;
  border-radius: 8px;
  overflow: hidden;
}

.pub-detail-media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.pub-detail-summary h1 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: #14241f;
}

.pub-detail-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.85rem;
}

.pub-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e8f2ee;
  color: #0b5f4b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
}

.pub-series-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.pub-series-card {
  background: #fff;
  border: 1px solid #ddd8ce;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.1rem;
}

.pub-series-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.pub-series-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #14241f;
}

.pub-pill {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e8f2ee;
  color: #0b5f4b;
}

.pub-series-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  color: #333;
}

.pub-series-meta span {
  color: #777;
  margin-right: 0.3rem;
}

.pub-tests-title {
  margin: 1.1rem 0 0.65rem;
  font-size: 0.95rem;
  color: #333;
}

.pub-empty-inline {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  color: #777;
}

.pub-test-table {
  border: 1px solid #e4dfd4;
  border-radius: 8px;
  overflow: hidden;
  background: #faf9f6;
  font-family: Arial, Helvetica, sans-serif;
}

.pub-test-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid #ebe6db;
}

.pub-test-row:first-child {
  border-top: 0;
}

.pub-test-row-head {
  background: #f0ebe3;
  color: #666;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.pub-test-row:not(.pub-test-row-head):nth-child(even) {
  background: #fff;
}

.pub-test-row:not(.pub-test-row-head):nth-child(odd) {
  background: #faf9f6;
}

.pub-test-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0b5f4b;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.pub-test-name {
  display: block;
  color: #14241f;
  font-size: 0.95rem;
  line-height: 1.35;
}

.pub-test-subject {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #777;
}

.pub-test-col-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.pub-chip {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #ece8e0;
  color: #444;
  font-size: 0.75rem;
  white-space: nowrap;
}

.pub-chip-free {
  background: #e8f2ee;
  color: #0b5f4b;
}

.pub-chip-paid {
  background: #f3eee6;
  color: #6a5535;
}

@media (max-width: 640px) {
  .pub-test-row,
  .pub-test-row-head {
    grid-template-columns: 40px 1fr;
  }

  .pub-test-col-meta {
    grid-column: 2;
    justify-content: flex-start;
  }

  .pub-test-row-head .pub-test-col-meta {
    display: none;
  }
}

.pub-detail-actions {
  margin-top: 1.75rem;
}

@media (max-width: 720px) {
  .pub-detail-hero {
    grid-template-columns: 1fr;
  }

  .pub-detail-media img {
    height: 200px;
  }
}

@media (max-width: 640px) {
  .pub-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
}

.pub-course-card.is-expired {
  opacity: 0.72;
}

.pub-course-card.is-expired .pub-enrolled-label {
  color: #7a3b00;
  background: #f5ebe0;
}
