body {
  margin: 0;
  font-family: Georgia, serif;
  background: #f7f3ec;
  color: #241f1a;
}

main {
  max-width: 950px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: #6f6258;
}

p {
  line-height: 1.7;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fffaf3;
  border: 1px solid #dfd3c3;
  border-radius: 18px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-3px);
}

.badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #8a6d45;
  letter-spacing: 0.08em;
}

#search {
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 2rem;
  border: 1px solid #dfd3c3;
  border-radius: 999px;
  font-size: 1rem;
  background: #fffaf3;
  color: #241f1a;
}

.thesaurus-class {
  margin-bottom: 3rem;
}

.thesaurus-section {
  margin: 1.5rem 0;
}

.thesaurus-head {
  background: #fffaf3;
  border: 1px solid #dfd3c3;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.thesaurus-head summary {
  cursor: pointer;
  font-weight: bold;
  color: #4a3424;
}

.pos-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eadfce;
}

.pos-block strong {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: #8a6d45;
  text-transform: capitalize;
}

.pos-block p {
  line-height: 1.65;
}

.thesaurus-subsection {
  margin: 1.25rem 0 2rem;
  padding-left: 1rem;
  border-left: 3px solid #dfd3c3;
}

.thesaurus-subsection h4 {
  margin-bottom: 0.75rem;
  color: #6f4f2f;
  font-size: 1.05rem;
  text-transform: none;
}

.division-title {
  margin-top: 2rem;
  color: #5d4030;
  border-bottom: 1px solid #dfd3c3;
  padding-bottom: 0.4rem;
}

.subsubsection-title {
  margin: 1rem 0 0.5rem;
  color: #7a5a3a;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.term-list {
  line-height: 1.75;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(100% - 2rem, 950px);
  margin-inline: auto;
  padding-block: 3rem;
}

.card-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

textarea {
  width: 100%;
  min-height: 260px;
  padding: 1rem;
  border: 1px solid #dfd3c3;
  border-radius: 16px;
  background: #fffaf3;
  color: #241f1a;
  font: inherit;
  line-height: 1.6;
}

button {
  margin: 1rem 0 2rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid #8a6d45;
  border-radius: 999px;
  background: #4a3424;
  color: #fffaf3;
  font: inherit;
  cursor: pointer;
}

button:hover {
  transform: translateY(-2px);
}

.result-card {
  background: #fffaf3;
  border: 1px solid #dfd3c3;
  border-radius: 18px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.chart-card {
  background: #fffaf3;
  border: 1px solid #dfd3c3;
  border-radius: 18px;
  padding: 1.5rem;
  margin: 1rem 0;
}

#network {
  width: 100%;
  height: 650px;
  background: #fffaf3;
  border: 1px solid #dfd3c3;
  border-radius: 18px;
  margin: 1.5rem 0;
}

select {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0.5rem 0 1.5rem;
  padding: 0.7rem;
  border: 1px solid #dfd3c3;
  border-radius: 999px;
  background: #fffaf3;
  font: inherit;
}

:root {
  --bg: #f7f3ec;
  --text: #241f1a;
  --muted: #6f6258;
  --card: #fffaf3;
  --border: #dfd3c3;
  --accent: #4a3424;
  --accent-soft: #8a6d45;
}

:root[data-theme="dark"] {
  --bg: #181512;
  --text: #f4eadc;
  --muted: #c7b8a3;
  --card: #241f1a;
  --border: #4d4035;
  --accent: #d7b98c;
  --accent-soft: #c89f67;
}

body {
  background: var(--bg);
  color: var(--text);
}

.card,
.result-card,
.chart-card,
.compare-panel,
.thesaurus-head,
#network,
textarea,
input,
select {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

a,
.thesaurus-head summary,
.badge,
.pos-block strong,
.division-title,
.subsubsection-title {
  color: var(--accent-soft);
}

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

button,
.theme-toggle {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

#head-search {
  width: 100%;
  max-width: 420px;
  margin: 0.5rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
}

th {
  background: var(--card);
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;

  font-size: 0.95rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-footer a:hover {
  opacity: 0.7;
}

.thesaurus-class,
.thesaurus-division,
.thesaurus-section,
.thesaurus-subsection,
.thesaurus-subsubsection,
.thesaurus-head {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
}

.thesaurus-division,
.thesaurus-section,
.thesaurus-subsection,
.thesaurus-subsubsection,
.thesaurus-head {
  margin-left: 1rem;
}

.thesaurus-class > summary,
.thesaurus-division > summary,
.thesaurus-section > summary,
.thesaurus-subsection > summary,
.thesaurus-subsubsection > summary,
.thesaurus-head > summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--accent-soft);
}

.pos-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

#text-network {
  width: 100%;
  height: 600px;
  background: var(--card);
  border-radius: 18px;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;

  margin-bottom: 3rem;
}

.hero-text {
  flex: 1;
}

.hero-logo {
  width: 110px;
  height: 110px;

  object-fit: contain;

  opacity: 0.95;
}