/* Rosetta writing-systems lab */

.ros-main {
  max-width: min(1400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Full alphabet / inventory grid */
.ros-alphabet {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line, #30363d);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel, #161b22) 92%, transparent);
}
.ros-alpha-head h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.ros-alpha-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: min(52vh, 480px);
  overflow: auto;
  padding: 2px;
}
.ros-alpha-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--line-soft, var(--line, #30363d));
  background: var(--bg, #0d1117);
}
.ros-alpha-g {
  font-size: 1.15rem;
  line-height: 1.2;
  font-family: "Noto Sans", "Noto Sans CJK", "Segoe UI Historic", "Apple Symbols",
    serif;
}
.ros-alpha-lab {
  font-size: 0.55rem;
  color: var(--muted, #8b949e);
  margin-top: 2px;
}

.ros-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 700 0.65rem/1 system-ui;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint, #8b949e);
}

.ros-toolbar input,
.ros-toolbar select {
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #30363d);
  background: var(--bg, #0d1117);
  color: var(--ink, #e6edf3);
  font: 500 0.9rem/1.2 system-ui;
  text-transform: none;
  letter-spacing: 0;
}

.ros-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
}

.ros-chip {
  appearance: none;
  border: 1px solid var(--line, #30363d);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: 600 0.72rem/1.2 system-ui;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ros-chip span {
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.ros-chip:hover,
.ros-chip.on {
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(125, 211, 252, 0.1);
}

.ros-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.15fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 900px) {
  .ros-grid {
    grid-template-columns: 1fr;
  }
}

.ros-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(70vh, 52rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.ros-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Digital-alphabet / DOJO-style cards */
.ros-card,
.ros-card--da {
  appearance: none;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--line, #30363d);
  background: var(--card, rgba(22, 27, 34, 0.65));
  color: inherit;
  font: inherit;
  cursor: pointer;
  line-height: 1.35;
  min-width: 0;
}

.ros-card:hover,
.ros-card.on,
.ros-card--da:hover,
.ros-card--da.on {
  border-color: color-mix(in srgb, var(--accent, #58a6ff) 55%, var(--line, #30363d));
  background: color-mix(in srgb, var(--accent, #58a6ff) 8%, var(--card, #161b22));
}

.ros-card-da-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.ros-card-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.ros-card-era {
  font-size: 0.68rem;
  opacity: 0.65;
  text-align: right;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ros-honor {
  color: var(--accent, #58a6ff);
  font-size: 0.85em;
}

.ros-card-type {
  font-size: 0.72rem;
  opacity: 0.7;
}

.ros-card-da-glyph {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg, #0d1117);
  border: 1px solid var(--line, #30363d);
  overflow: hidden;
}

.ros-sample,
.ros-sample--da {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
  opacity: 0.95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ros-sample--media {
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: normal;
  letter-spacing: 0;
}

.ros-card-da-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ros-chiplet {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line, #30363d);
  font: 650 0.65rem/1.2 system-ui, sans-serif;
  color: var(--accent, #58a6ff);
  background: color-mix(in srgb, var(--accent, #58a6ff) 8%, transparent);
}

.ros-card-meta {
  font-size: 0.72rem;
  opacity: 0.7;
}

.ros-detail-head h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.ros-alt {
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 0 0 10px;
}

.ros-dl {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.ros-dl div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 8px;
  font-size: 0.88rem;
}

.ros-dl dt {
  margin: 0;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

.ros-dl dd {
  margin: 0;
}

.ros-big-sample {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #30363d);
  background: rgba(0, 0, 0, 0.25);
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.ros-glyph {
  font-size: 1.15em;
  letter-spacing: 0.06em;
}

.ros-note {
  font-size: 0.8rem;
  opacity: 0.72;
  line-height: 1.4;
}

.ros-ul {
  margin: 0 0 12px;
  padding-left: 1.1rem;
  line-height: 1.5;
}

.ros-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent, #58a6ff);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.ros-concepts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ros-concept-row h3 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.ros-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ros-cell {
  appearance: none;
  border: 1px solid var(--line, #30363d);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  min-width: 4.5rem;
  max-width: 9rem;
  font: inherit;
}

.ros-cell:hover {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(125, 211, 252, 0.08);
}

.ros-cell .ros-glyph {
  font-size: 1.25rem;
}

.ros-cell-lab {
  font-size: 0.65rem;
  opacity: 0.7;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ros-detail-col h3 {
  margin: 12px 0 6px;
  font-size: 0.9rem;
}
