:root {
  --nagano-ink: #4b4046;
  --nagano-muted: #71666c;
  --nagano-line: #e9e1e5;
  --nagano-purple: #6758c6;
  --nagano-soft: #f3f0ff;
  --nagano-green: #24705a;
  --nagano-green-soft: #eaf7f1;
  --nagano-gold: #9a671d;
  --nagano-gold-soft: #fff4dc;
}

.nagano-page {
  min-height: 100vh;
  color: var(--nagano-ink);
  background: linear-gradient(135deg, #fff9fb, #f8f7ff 54%, #f2faf6);
}

.nagano-shell {
  width: min(1060px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 50px;
}

.nagano-breadcrumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--nagano-muted);
  font-size: 11px;
  font-weight: 700;
}

.nagano-breadcrumbs a {
  color: var(--nagano-purple);
}

.nagano-hero,
.nagano-note,
.nagano-profile-section,
.nagano-history-section,
.nagano-themes-section {
  border: 1px solid var(--nagano-line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(72, 56, 65, 0.07);
}

.nagano-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
}

.nagano-eyebrow {
  color: #8b78e7;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.nagano-hero h2 {
  margin: 7px 0;
  color: var(--nagano-ink);
  font-size: 25px;
  line-height: 1.45;
}

.nagano-hero p,
.nagano-note p,
.nagano-history-heading p,
.nagano-themes-heading p {
  margin: 0;
  color: var(--nagano-muted);
  font-size: 12px;
  line-height: 1.9;
}

.nagano-map-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #d9d1ff;
  border-radius: 999px;
  color: var(--nagano-purple);
  background: var(--nagano-soft);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.nagano-hero-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.nagano-history-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--nagano-purple);
  border-radius: 999px;
  color: #fff;
  background: var(--nagano-purple);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.nagano-history-link:hover,
.nagano-history-link:focus-visible {
  color: #fff;
  background: #5143ae;
}

.nagano-note {
  margin-top: 14px;
  padding: 19px 22px;
}

.nagano-note h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.nagano-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
  padding: 7px;
  border: 1px solid var(--nagano-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(72, 56, 65, 0.05);
}

.nagano-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--nagano-muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.nagano-tabs button:hover,
.nagano-tabs button:focus-visible {
  color: var(--nagano-purple);
  background: var(--nagano-soft);
}

.nagano-tabs button[aria-selected="true"] {
  border-color: #d7cffb;
  color: var(--nagano-purple);
  background: #fff;
  box-shadow: 0 5px 15px rgba(85, 68, 153, 0.1);
}

.nagano-tab-panel[hidden] {
  display: none;
}

.nagano-profile-section,
.nagano-history-section,
.nagano-themes-section {
  margin-top: 14px;
  padding: 26px;
  scroll-margin-top: 18px;
}

.nagano-profile-intro {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nagano-profile-mark {
  display: grid;
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid #d7cffb;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(145deg, #8b78e7, #6758c6 58%, #397d68);
  box-shadow: 0 12px 24px rgba(103, 88, 198, 0.2);
  font-size: 34px;
  font-weight: 900;
}

.nagano-profile-reading {
  margin: 5px 0 0;
  color: var(--nagano-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.nagano-profile-intro h2 {
  margin: 1px 0 2px;
  font-size: 30px;
  line-height: 1.35;
}

.nagano-profile-role {
  margin: 0;
  color: var(--nagano-purple);
  font-size: 11px;
  font-weight: 900;
}

.nagano-profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-top: 22px;
}

.nagano-profile-copy,
.nagano-profile-details {
  padding: 20px;
  border: 1px solid var(--nagano-line);
  border-radius: 19px;
}

.nagano-profile-copy {
  background: linear-gradient(145deg, #faf8ff, #fff 58%, #f2fbf7);
}

.nagano-profile-copy p {
  margin: 0;
  color: var(--nagano-muted);
  font-size: 12px;
  line-height: 1.95;
}

.nagano-profile-copy p + p {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--nagano-line);
}

.nagano-profile-details {
  display: grid;
  gap: 18px;
  background: #fff;
}

.nagano-profile-details h3 {
  margin: 0 0 9px;
  font-size: 12px;
}

.nagano-profile-works {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nagano-profile-works li {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--nagano-green);
  background: var(--nagano-green-soft);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.5;
}

.nagano-profile-interests {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--nagano-line);
  border-radius: 19px;
  background: linear-gradient(135deg, #fff9ec, #fff 54%, #f5fbf8);
}

.nagano-profile-interests-heading h3 {
  margin: 5px 0 0;
  font-size: 16px;
}

.nagano-profile-interest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.nagano-profile-interest-card {
  padding: 15px;
  border: 1px solid rgba(103, 88, 198, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.nagano-profile-interest-card h4 {
  margin: 0 0 6px;
  color: var(--nagano-purple);
  font-size: 11px;
}

.nagano-profile-interest-card p {
  margin: 0;
  color: var(--nagano-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.75;
}

.nagano-profile-links,
.nagano-profile-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nagano-profile-source-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--nagano-line);
}

.nagano-profile-source-block > span {
  flex: 0 0 auto;
  padding-top: 8px;
  color: var(--nagano-muted);
  font-size: 9px;
  font-weight: 900;
}

.nagano-history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.nagano-history-heading h2,
.nagano-themes-heading h2 {
  margin: 7px 0;
  color: var(--nagano-ink);
  font-size: 24px;
  line-height: 1.45;
}

.nagano-history-count {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  padding: 11px 15px;
  border-radius: 16px;
  color: var(--nagano-purple);
  background: var(--nagano-soft);
}

.nagano-history-count strong {
  font-size: 27px;
  line-height: 1;
}

.nagano-history-count span {
  font-size: 10px;
  font-weight: 900;
}

.nagano-history-filters {
  display: flex;
  gap: 7px;
  margin: 20px 0 4px;
  overflow-x: auto;
  padding: 2px 1px 6px;
  scrollbar-width: thin;
}

.nagano-history-filters button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #ded6da;
  border-radius: 999px;
  color: var(--nagano-muted);
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.nagano-history-filters button:hover,
.nagano-history-filters button:focus-visible,
.nagano-history-filters button.is-active {
  border-color: var(--nagano-purple);
  color: var(--nagano-purple);
  background: var(--nagano-soft);
}

.nagano-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.nagano-timeline::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 87px;
  width: 2px;
  background: linear-gradient(#cfc5ff, #c8eadc);
}

.nagano-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.nagano-history-date {
  position: relative;
  padding-top: 14px;
  text-align: right;
}

.nagano-history-date::after {
  content: "";
  position: absolute;
  top: 21px;
  right: -23px;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #9b8ce8;
  box-shadow: 0 0 0 1px #cfc5ff;
}

.nagano-history-date strong,
.nagano-history-date span {
  display: block;
}

.nagano-history-date strong {
  color: var(--nagano-purple);
  font-size: 13px;
}

.nagano-history-date span {
  margin-top: 3px;
  color: var(--nagano-muted);
  font-size: 9px;
  line-height: 1.5;
}

.nagano-history-card {
  padding: 18px 19px;
  border: 1px solid var(--nagano-line);
  border-radius: 19px;
  background: #fff;
}

.nagano-history-item.is-featured .nagano-history-card {
  border-color: #d5cdfb;
  background: linear-gradient(135deg, #fff, #faf8ff 62%, #f2fbf7);
  box-shadow: 0 8px 22px rgba(90, 71, 151, 0.08);
}

.nagano-history-item.is-featured .nagano-history-date::after {
  background: var(--nagano-green);
  box-shadow: 0 0 0 1px #8fc9b6;
}

.nagano-history-card h3 {
  margin: 0;
  color: var(--nagano-ink);
  font-size: 17px;
  line-height: 1.55;
}

.nagano-history-card > p {
  margin: 8px 0 0;
  color: var(--nagano-muted);
  font-size: 12px;
  line-height: 1.9;
}

.nagano-history-tags,
.nagano-history-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nagano-history-tags {
  margin-bottom: 9px;
}

.nagano-history-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--nagano-green);
  background: var(--nagano-green-soft);
  font-size: 9px;
  font-weight: 900;
}

.nagano-history-sources {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--nagano-line);
}

.nagano-history-sources a,
.nagano-theme-card a,
.nagano-profile-links a,
.nagano-profile-sources a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--nagano-purple);
  background: var(--nagano-soft);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.5;
  text-decoration: none;
}

.nagano-history-sources a:hover,
.nagano-history-sources a:focus-visible,
.nagano-theme-card a:hover,
.nagano-theme-card a:focus-visible,
.nagano-profile-links a:hover,
.nagano-profile-links a:focus-visible,
.nagano-profile-sources a:hover,
.nagano-profile-sources a:focus-visible {
  color: #4c3dad;
  background: #e9e4ff;
}

.nagano-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.nagano-theme-card {
  padding: 18px;
  border: 1px solid var(--nagano-line);
  border-radius: 19px;
  background: #fff;
}

.nagano-theme-card:first-child {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fff7e6, #fff 62%);
}

.nagano-theme-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 31px;
  min-height: 31px;
  border-radius: 10px;
  color: var(--nagano-gold);
  background: var(--nagano-gold-soft);
  font-size: 11px;
  font-weight: 900;
}

.nagano-theme-card h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  line-height: 1.55;
}

.nagano-theme-card p {
  margin: 0;
  color: var(--nagano-muted);
  font-size: 11px;
  line-height: 1.85;
}

.nagano-theme-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.nagano-result {
  margin: 15px 1px 10px;
  color: var(--nagano-muted);
  font-size: 11px;
  font-weight: 800;
}

.nagano-empty {
  padding: 30px;
  border: 1px dashed #ddd4d9;
  border-radius: 16px;
  color: var(--nagano-muted);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.nagano-empty.is-error {
  color: #9f394b;
  background: #fff4f5;
}

@media (max-width: 700px) {
  .nagano-shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .nagano-hero,
  .nagano-history-heading,
  .nagano-profile-source-block {
    align-items: stretch;
    flex-direction: column;
  }

  .nagano-map-link,
  .nagano-history-link,
  .nagano-hero-actions {
    flex-basis: auto;
    width: 100%;
  }

  .nagano-profile-body {
    grid-template-columns: 1fr;
  }

  .nagano-profile-source-block > span {
    padding-top: 0;
  }

  .nagano-timeline::before {
    left: 8px;
  }

  .nagano-history-item {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-left: 25px;
  }

  .nagano-history-date {
    padding-top: 0;
    text-align: left;
  }

  .nagano-history-date::after {
    top: 4px;
    right: auto;
    left: -22px;
  }

  .nagano-history-date strong,
  .nagano-history-date span {
    display: inline;
  }

  .nagano-history-date span {
    margin-left: 6px;
  }

  .nagano-theme-grid {
    grid-template-columns: 1fr;
  }

  .nagano-profile-interest-list {
    grid-template-columns: 1fr;
  }

  .nagano-theme-card:first-child {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .nagano-tabs button {
    gap: 4px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .nagano-profile-intro {
    align-items: flex-start;
  }

  .nagano-profile-mark {
    flex-basis: 66px;
    width: 66px;
    height: 66px;
    border-radius: 22px;
    font-size: 27px;
  }

  .nagano-profile-section,
  .nagano-history-section,
  .nagano-themes-section {
    padding: 20px;
  }
}
