:root {
  --page-max-width: 1600px;
  --page-pad-x: 24px;
  --page-pad-y: 12px;
  --page-bg: #f6f7fb;
  --page-text: #222;
  --menu-border: #e5e7eb;
  --menu-muted-bg: #f3f4f6;
  --menu-active-bg: #0f766e;
  --header-height: 57px;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-text);
  font-family: "Nunito", Arial, sans-serif;
}

.wrap {
  width: 100%;
  max-width: min(var(--page-max-width), 100vw);
  margin: 0;
  padding: 0 var(--page-pad-x) var(--page-pad-y);
  box-sizing: border-box;
}

.top-header {
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: #fff;
  margin: 0 calc(-1 * var(--page-pad-x));
  padding: 8px var(--page-pad-x);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
  margin-bottom: 14px;
  transition: transform 0.25s ease;
}

.top-header.header-hidden {
  transform: translateY(-100%);
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: var(--menu-muted-bg);
  border: 1px solid var(--menu-border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.search-bar {
  display: flex;
  flex: 1;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: #fff;
  color: #111827;
  outline: none;
  min-width: 0;
}

.search-bar .search-input {
  border-radius: 10px 0 0 10px;
  border-right: none;
  font-size: 15px;
  padding: 10px 14px;
}

.search-input:focus { border-color: #0f766e; }

.search-btn {
  padding: 10px 16px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.search-btn:hover { background: #0d5a54; }

.site-title {
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 800;
  line-height: 1.05;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
}

.top-menu {
  background: #fff;
  border: 1px solid var(--menu-border);
  border-radius: 12px;
  padding: 8px 10px;
}

.top-menu-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-link {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  background: var(--menu-muted-bg);
  font-family: "Nunito", Arial, sans-serif;
  line-height: 1.2;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
}

.top-link.active {
  background: var(--menu-active-bg);
  color: #fff;
}

.menu-browse-section { display: none; }
.menu-sep { border: none; border-top: 1px solid var(--menu-border); margin: 6px 0; }
.menu-search-wrap { display: none; }
.menu-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #9ca3af; padding: 2px 4px 6px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  gap: 8px;
}

.pager-prev,
.pager-next {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.pager-prev:hover:not(:disabled),
.pager-next:hover:not(:disabled) {
  background: #f0fdfa;
  border-color: #ccfbf1;
  color: #0f766e;
}

.pager-prev:disabled,
.pager-next:disabled {
  color: #c4c9d4;
  cursor: not-allowed;
  background: #f9fafb;
}

.pager-pages {
  display: flex;
  align-items: center;
  gap: 3px;
}

.pager-page {
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.pager-page:hover:not(.pager-page-current) {
  background: #f0fdfa;
  border-color: #ccfbf1;
  color: #0f766e;
}

.pager-page-current {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
  font-weight: 700;
  cursor: default;
}

.pager-ellipsis {
  padding: 0 3px;
  color: #9ca3af;
  font-size: 15px;
  user-select: none;
}

.pager-pos {
  display: none;
  font-size: 15px;
  color: #6b7280;
}

@media (max-width: 640px) {
  .pager-pages { display: none; }
  .pager-pos { display: block; }
  .pager-prev, .pager-next { padding: 10px 18px; font-size: 16px; }
}

.footer-load {
  text-align: left;
  color: #6b7280;
  font-size: 12px;
  padding: 10px var(--page-pad-x) 14px;
  box-sizing: border-box;
}

.flash {
  padding: 12px;
  background: #e7f5ff;
  border: 1px solid #a5d8ff;
  border-radius: 10px;
  margin-bottom: 16px;
}

.admin-notify {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 14px;
}

@media (max-width: 900px) {
  :root {
    --page-pad-x: 18px;
    --page-pad-y: 18px;
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad-x: 14px;
    --page-pad-y: 14px;
  }

  .top-header {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px var(--page-pad-x);
  }

  .site-title {
    font-size: 20px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .hamburger-btn {
    display: flex;
    margin-left: auto;
  }

  .top-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 260px;
    max-width: calc(100vw - var(--page-pad-x) * 2);
    background: #fff;
    border: none;
    border-top: 1px solid var(--menu-border);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    padding: 10px var(--page-pad-x) 14px;
    z-index: 99;
  }

  .top-menu.menu-open {
    display: block;
  }

  .top-menu-links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
  }

  .header-search { display: none; }

  .menu-search-wrap { display: block; margin-bottom: 8px; }
  .menu-search-wrap .search-bar { width: 100%; }

  .menu-browse-section { display: block; }
  .top-menu .side-link { margin-bottom: 6px; }

  .top-link {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    width: 100%;
  }

  .top-menu .top-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 4px;
    border-radius: 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    width: 100%;
    text-decoration: none;
  }
  .top-menu .top-link:hover { background: none; color: #0f766e; }
  .top-menu .top-link.active { background: none; color: #0f766e; border: none; }

  .top-menu .side-link {
    background: none;
    border: none;
    border-radius: 0;
    padding: 7px 4px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
  }
  .top-menu .side-link:hover { background: none; border: none; color: #0f766e; }
  .top-menu .side-link.active { background: none; border: none; color: #0f766e; }
  .top-menu .side-link.active .side-count { background: none; color: #0f766e; }
  .top-menu .side-count { background: none; padding: 0; color: #9ca3af; }
}

input[type=text],
input[type=url],
input[type=number],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: "Nunito", Arial, sans-serif;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
  color: #667085;
  font-size: 14px;
}

.breadcrumbs a,
.breadcrumbs span {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #0f766e;
}

.breadcrumbs a::after {
  content: "/";
  color: #98a2b3;
  margin-left: 7px;
}

.breadcrumbs span[aria-current="page"] {
  color: #1f2937;
  font-weight: 700;
}

.breadcrumbs .breadcrumb-back {
  margin-left: 6px;
  color: #475467;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 700;
}

.breadcrumbs .breadcrumb-back::after {
  content: "";
  margin: 0;
}
