#oghamView {
  line-height: 1.75;
}

#oghamView h3,
#oghamView h4,
#oghamView p {
  margin-top: 0;
}

#oghamView h3 {
  margin-bottom: 12px;
  font-size: 21px;
}

.ogham-heading {
  align-items: center;
}

.ogham-region {
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--accent-strong);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ogham-meta,
.ogham-note,
.ogham-korean {
  color: var(--muted);
  font-size: 13px;
}

#oghamView .ogham-meta {
  margin: 14px 0;
}

.ogham-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.ogham-tabs button,
.ogham-next button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ogham-tabs button[aria-pressed="true"],
.ogham-tabs button:hover,
.ogham-next button:hover {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid));
}

#oghamView :focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.mega-menu [data-arcana-view][aria-current="page"] {
  color: var(--accent-strong);
}

.ogham-intro,
.ogham-section {
  margin: 24px 0;
}

.ogham-intro p {
  max-width: 900px;
}

.ogham-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--panel-soft);
}

.ogham-stats > div {
  display: grid;
  gap: 3px;
  padding: 16px 20px;
}

.ogham-stats > div + div {
  border-left: 1px solid var(--line);
}

.ogham-stats strong {
  color: var(--accent-strong);
  font-size: 32px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.ogham-stats small,
.ogham-stats span {
  font-size: 13px;
  color: var(--muted);
}

.ogham-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 44px;
  margin: 0 0 16px;
  padding-left: 24px;
}

.ogham-steps li::marker {
  color: var(--accent-strong);
  font-weight: 800;
}

.ogham-steps p {
  margin: 6px 0 0;
  font-size: 14px;
}

.ogham-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 12px;
}

.ogham-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.ogham-table caption {
  padding: 10px 14px;
  color: var(--muted);
  background: var(--panel-soft);
  text-align: left;
  font-size: 12px;
}

.ogham-table th,
.ogham-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.ogham-table th {
  background: var(--panel-soft);
  white-space: nowrap;
}

.ogham-table tbody tr:last-child td {
  border-bottom: 0;
}

.ogham-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.ogham-score-example,
.ogham-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ogham-score-example span {
  padding: 8px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ogham-score-example strong {
  color: var(--accent-strong);
  margin-left: 6px;
}

.ogham-update {
  padding: 18px 20px;
  border-left: 3px solid var(--accent-strong);
  background: var(--panel-soft);
}

.ogham-update p:last-child {
  margin-bottom: 0;
}

.ogham-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 12px;
}

.ogham-toolbar .grow {
  flex: 1;
  min-width: 220px;
}

.ogham-toolbar input,
.ogham-toolbar select {
  width: 100%;
  max-width: 100%;
}

.ogham-combinations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ogham-combo {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.ogham-combo-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ogham-combo h4 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.5;
}

.ogham-korean {
  overflow-wrap: anywhere;
}

.ogham-recipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block: 14px;
}

.ogham-recipe > b {
  color: var(--muted);
}

.ogham-word-chip {
  display: grid;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-solid);
  font-size: 12px;
}

.ogham-word-chip small {
  color: var(--muted);
}

.ogham-word-chip.special {
  border-color: var(--accent-strong);
}

.ogham-word-chip em {
  color: var(--accent-strong);
  font-size: 10px;
  font-style: normal;
}

#oghamView .ogham-combo-summary {
  margin-bottom: 0;
  font-size: 14px;
}

.ogham-catalog {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ogham-catalog summary {
  cursor: pointer;
  font-weight: 700;
}

.ogham-catalog > .ogham-table-wrap {
  margin-top: 16px;
}

.ogham-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.ogham-word-entry {
  display: grid;
  gap: 4px;
}

.ogham-word-entry > span {
  color: var(--muted);
  font-size: 12px;
}

.ogham-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 28px;
  font-size: 13px;
}

.ogham-sources span {
  display: grid;
}

.ogham-sources small {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .ogham-combinations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .ogham-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ogham-stats > div { padding: 14px; }
  .ogham-stats > div:nth-child(3) { border-left: 0; }
  .ogham-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ogham-steps, .ogham-combinations { grid-template-columns: minmax(0, 1fr); }
  .ogham-toolbar { flex-direction: column; }
  .ogham-toolbar .grow, .ogham-toolbar select, .ogham-toolbar input { min-width: 0; }
  .ogham-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ogham-tabs button { padding: 8px; }
  .ogham-table { min-width: 540px; }
  .ogham-sources { flex-direction: column; gap: 12px; }
}
