:root {
  --nav-surface: #ffffff;
  --nav-sunk:    #e6e8e5;
  --nav-line:    #cfd3ce;
  --nav-ink:     #14171a;
  --nav-ink-3:   #767f86;
  --nav-notice-bg:  #fdf1d8;
  --nav-notice-ink: #6d4c00;
  --tap: 44px;
}

.page-head { display: flex; align-items: center; gap: 12px; }

.nav { position: relative; }
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; }

.nav-button {
  display: flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  border: 1px solid var(--nav-line);
  border-radius: 10px;
  background: var(--nav-surface);
  cursor: pointer;
}
.nav-toggle:focus-visible + .nav-button { outline: 3px solid var(--nav-ink); outline-offset: 2px; }

.nav-bars, .nav-bars::before, .nav-bars::after {
  display: block; width: 18px; height: 2px;
  background: var(--nav-ink); border-radius: 1px;
}
.nav-bars { position: relative; }
.nav-bars::before, .nav-bars::after { content: ""; position: absolute; left: 0; }
.nav-bars::before { top: -6px; }
.nav-bars::after  { top: 6px; }

.nav-panel {
  display: none;
  position: absolute; right: 0; top: calc(var(--tap) + 8px);
  min-width: 220px; z-index: 30;
  flex-direction: column;
  background: var(--nav-surface);
  border: 1px solid var(--nav-line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20,23,26,.16);
  overflow: hidden;
}
.nav-toggle:checked ~ .nav-panel { display: flex; }

.nav-link {
  display: flex; align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  font-size: 14.5px; font-weight: 600;
  color: var(--nav-ink); text-decoration: none;
  border-bottom: 1px solid var(--nav-line);
}
.nav-link:last-child { border-bottom: 0; }
.nav-link:hover { background: var(--nav-sunk); }
.nav-link-cta { background: var(--nav-ink); color: #fff; }
.nav-link-cta:hover { background: #000; }
.nav-link-staff { color: var(--nav-notice-ink); background: var(--nav-notice-bg); }
.nav-link-button {
  width: 100%; border: 0; background: none; font: inherit;
  font-weight: 600; text-align: left; cursor: pointer;
}
.nav-form { margin: 0; border-bottom: 1px solid var(--nav-line); }
.nav-me {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; margin: 4px 12px;
  background: #2e7d32; color: #fff; font-size: 14px;
  font-weight: 700; text-decoration: none; overflow: hidden; flex: 0 0 auto;
}
.nav-me-img { width: 100%; height: 100%; object-fit: cover; }
.nav-me-initial { line-height: 1; }

.nav-group { border-bottom: 1px solid var(--nav-line); }
.nav-group:last-child { border-bottom: 0; }
.nav-group-label { list-style: none; cursor: pointer; gap: 6px; }
.nav-group-label::-webkit-details-marker { display: none; }
.nav-group-label::after {
  content: ""; width: 6px; height: 6px; margin-left: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease; opacity: .6;
}
.nav-group[open] > .nav-group-label::after { transform: rotate(-135deg); }

.nav-pop { display: flex; flex-direction: column; }
.nav-pop-link {
  display: flex; align-items: center; min-height: var(--tap);
  padding: 0 16px 0 28px;
  font-size: 14px; font-weight: 500;
  color: var(--nav-ink); text-decoration: none;
}
.nav-pop-link:hover { background: var(--nav-sunk); }
.nav-pop-link-staff { color: var(--nav-notice-ink); background: var(--nav-notice-bg); }
.nav-pop-form { margin: 0; }
.nav-pop-button {
  width: 100%; border: 0; background: none; font: inherit;
  font-weight: 500; text-align: left; cursor: pointer;
}

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

@media (min-width: 720px) {
  .nav-button { display: none; }

  #nav-install { display: none; }
  .nav-panel {
    display: flex; flex-direction: row; align-items: center; position: static;
    border: 0; box-shadow: none; background: none; min-width: 0;
    overflow: visible;
  }
  .nav-link { border-bottom: 0; border-radius: 9px; padding: 0 12px; }
  .nav-form { border-bottom: 0; }

  .nav-me-summary { padding: 0; min-height: 0; border: 0; }
  .nav-me-summary .nav-me-label { display: none; }
  .nav-me-summary.nav-group-label::after { display: none; }
  .nav-me-summary .nav-me { display: inline-flex; }
  .nav-me { margin: 0 0 0 8px; }

  .nav-group { border-bottom: 0; position: relative; }
  .nav-group-label { border-radius: 9px; padding: 0 12px; }
  .nav-pop {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 200px; z-index: 40;
    background: var(--nav-surface);
    border: 1px solid var(--nav-line); border-radius: 12px;
    box-shadow: 0 8px 28px rgba(20,23,26,.16);
    overflow: hidden; padding: 4px;
  }
  .nav-pop-link { padding: 0 14px; border-radius: 8px; min-height: 40px; }
  .nav-group-me .nav-pop { min-width: 220px; }
}

.foot-legal {
  display: inline-flex; align-items: center; gap: 12px;
  margin-left: auto; padding-left: 12px;
}
.foot-legal a { color: var(--ink-3); font-size: 11.5px; font-weight: 500;
  text-decoration: none; }
.foot-legal a:hover { text-decoration: underline; }
.foot-legal .version { color: var(--ink-3); font-size: 11.5px; }
@media (max-width: 560px) {
  .foot-legal { gap: 8px; }
  .foot-legal a { font-size: 11px; }
}

.foot-nav-flat {
  display: flex; align-items: center; gap: 4px 14px;
  flex-wrap: nowrap; width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.foot-nav-flat::-webkit-scrollbar { display: none; }
.foot-links {
  display: inline-flex; align-items: center; gap: 4px 14px;
  flex-wrap: nowrap;
}
.foot-links a {
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  text-decoration: none; padding: 4px 2px; min-height: 32px;
  display: inline-flex; align-items: center;
}
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 560px) {
  .foot-links { gap: 2px 12px; }
  .foot-links a { font-size: 12.5px; }
}

.built-by { font-size: 12px; opacity: .75; text-decoration: none; }
.built-by:hover { opacity: 1; text-decoration: underline; }

.foot-links a.foot-support {
  background: #23357a;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  padding: 0 12px;
  min-height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.foot-links a.foot-support:hover {
  background: #1b2a63;
  color: #ffffff;
  text-decoration: none;
}

.langpick { position: relative; flex: 0 0 auto; }
.langpick + .nav { margin-left: 10px; }
.langpick-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 40px; min-width: 44px; padding: 0 10px;
  box-sizing: border-box; cursor: pointer; list-style: none;
  border: 1px solid var(--line, #cdd2d8); border-radius: 8px;
  background: #fff; color: var(--ink);
  font-weight: 700; font-size: 0.9rem; white-space: nowrap;
}
.langpick-chip::-webkit-details-marker { display: none; }
.langpick-chip::marker { content: ""; }
.langpick-chip:hover { border-color: var(--ink); }
.langpick[open] .langpick-chip { border-color: var(--ink); }
.langpick-caret { font-size: 0.7rem; color: var(--ink-2); }
.langpick-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 180px; max-height: 60vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line, #cdd2d8);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  padding: 4px;
}
.langpick-menu form { margin: 0; }
.langpick-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  box-sizing: border-box; cursor: pointer; text-align: left;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--ink); font-size: 1rem;
}
.langpick-item:hover, .langpick-item:focus { background: #f2f4f6; }
.langpick-item.is-current { font-weight: 700; }
.langpick-tick { color: #2e7d32; }

.nav-bell-btn { position: relative; cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; font-size: 18px; }
.nav-bell-btn::-webkit-details-marker { display: none; }

.nav-bell { position: relative; flex: 0 0 auto; }
.nav-bell > .nav-bell-btn { border-radius: 10px; }

.nav-bell[open] > .nav-bell-pop,
.nav-bell > .nav-bell-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  z-index: 41;
  background: var(--nav-surface, #fff);
  border: 1px solid var(--nav-line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20,23,26,.16);
  overflow: hidden; padding: 4px;
}

.nav-bell-count { position: absolute; top: 2px; right: 0;
  background: #c62828; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; box-sizing: border-box;
  box-shadow: 0 0 0 2px var(--surface-raised, #fff); }
.nav-bell-pop { min-width: 300px; max-width: 360px; }
.nav-bell-head { font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #666e76; padding: 8px 12px 4px; }
.nav-bell-list { list-style: none; margin: 0; padding: 0;
  max-height: 60vh; overflow-y: auto; }
.nav-bell-empty { padding: 10px 12px; color: #666e76; font-size: 13px; }
.notif { border-top: 1px solid #e6e3dd; }
.notif a, .notif > span { display: block; padding: 9px 12px;
  text-decoration: none; color: inherit; }
.notif.is-unread { background: #f2f6ff; }
.notif-title { display: block; font-weight: 600; font-size: 13.5px; }
.notif-body  { display: block; font-size: 12.5px; color: #666e76; }
.notif-when  { display: block; font-size: 11.5px; color: #8a9099; }
.nav-bell-head { display: flex; align-items: center;
  justify-content: space-between; gap: 10px; }
.nav-bell-clear { background: none; border: 0; padding: 0; font: inherit;
  font-size: 12px; text-transform: none; letter-spacing: 0;
  color: #23357a; cursor: pointer; text-decoration: underline; }
.nav-bell-clear[hidden] { display: none; }

.nav-bell-head { display: flex; align-items: baseline;
  justify-content: space-between; gap: 10px; }
.nav-bell-clear { background: none; border: 0; padding: 0; font: inherit;
  font-size: 12px; color: #23357a; cursor: pointer; text-decoration: underline; }
.nav-bell-clear[hidden] { display: none; }
.notif { position: relative; display: flex; align-items: flex-start; }
.notif > a, .notif > span { flex: 1 1 auto; }
.notif-x { flex: 0 0 auto; background: none; border: 0; cursor: pointer;
  font-size: 18px; line-height: 1; color: #8a9099; padding: 9px 10px; }
.notif-x:hover { color: #c62828; }
