/* The ko/so/a guide (pointing_guide.js): the back's "Family" link and the overlay with its two
   grids, the old app's rules as they are (web/static/css/phaseb.css:1955-2131). */

/* The guide's block is hidden on most cards; the Kanji block above it keeps its last-child
   spacing then. */
.dk-block:has(+ .dk-block--kosoa.hidden) { margin-bottom: 0; }
.dk-kosoa-overlay.hidden { display: none; }
.dk-kosoa-panel { box-sizing: border-box; }  /* the old page sized every box this way */
.dk-kosoa-panel:focus { outline: none; }  /* focused on open only to hold the keyboard */

.dk-kosoa-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--lav-ui);
  font-size: 13px;
  color: var(--lav-purple);
  opacity: 0.7;
  cursor: pointer;
  text-decoration: none;
}
.dk-kosoa-link:hover { opacity: 1; }

.dk-kosoa-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dk-kosoa-panel {
  background: var(--lav-panel, #fff);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px 24px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.dk-kosoa-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dk-kosoa-panel__title {
  font-family: var(--lav-display);
  font-style: italic;
  font-size: 20px;
  color: var(--lav-ink);
}
.dk-kosoa-panel__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--lav-ink-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.dk-kosoa-panel__close:hover { color: var(--lav-ink); }

.dk-kosoa-intro {
  font-family: var(--lav-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--lav-ink-soft);
  margin: 0 0 18px;
}
.dk-kosoa-intro strong {
  color: var(--lav-ink);
  font-weight: 600;
}
.dk-kosoa-bullets {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.dk-kosoa-bullets li {
  padding: 2px 0;
}
.dk-kosoa-bullets li::before {
  content: "·";
  margin-right: 6px;
  color: var(--lav-ink-muted);
}

.dk-kosoa-grid {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--lav-ui);
  font-size: 12px;
}
.dk-kosoa-grid th {
  font-family: var(--lav-jp);
  font-size: 14px;
  font-weight: 600;
  color: var(--lav-purple);
  padding: 6px 8px;
  text-align: center;
  border-bottom: 2px solid var(--lav-hairline);
}
.dk-kosoa-grid th span {
  display: block;
  font-family: var(--lav-ui);
  font-size: 10px;
  font-weight: 400;
  color: var(--lav-ink-muted);
  margin-top: 1px;
}
.dk-kosoa-grid td {
  padding: 8px 8px;
  text-align: center;
  border-bottom: 1px solid var(--lav-hairline-soft);
  vertical-align: middle;
}
.dk-kosoa-grid tr:last-child td { border-bottom: none; }
.dk-kosoa-grid__label {
  text-align: right !important;
  font-size: 11px;
  color: var(--lav-ink-muted);
  font-style: italic;
  white-space: nowrap;
  padding-right: 12px !important;
}
.dk-kosoa-grid__jp {
  font-family: var(--lav-jp);
  font-size: 15px;
  color: var(--lav-ink);
  display: block;
}
.dk-kosoa-grid__en {
  font-size: 10px;
  color: var(--lav-ink-muted);
  display: block;
  margin-top: 1px;
}

/* Guide terms (aag-1561): a Japanese word with its reading beside it,
   食べている (たべている, tabete iru). The reading sits a size down in soft
   lavender so the word stays the thing you look at. In a grid's example
   cell it tucks under the word, like furigana that slid down a line; a term
   quoted inside a label or meaning stays inline. */
.dk-term__jp {
  font-family: var(--lav-jp);
  color: var(--lav-ink);
}
.dk-term__rd {
  font-family: var(--lav-ui);
  font-size: 0.82em;
  color: var(--lav-purple);
  opacity: 0.78;
}
.dk-kosoa-grid .dk-term__rd { font-size: 11px; }
/* A word never splits mid-word in a narrow column (あそこ wrapped "あそ / こ"). */
.dk-kosoa-grid .dk-term__jp { word-break: keep-all; }
.dk-kosoa-grid__jp .dk-term__rd {
  display: block;
  margin-top: 1px;
}

.dk-kosoa-panel__foot {
  margin-top: 16px;
  text-align: center;
}
.dk-kosoa-panel__foot:empty { margin-top: 0; }
.dk-kosoa-panel__btn {
  background: none;
  border: 1px solid var(--lav-hairline);
  border-radius: 8px;
  padding: 8px 20px;
  font-family: var(--lav-ui);
  font-size: 13px;
  color: var(--lav-purple);
  cursor: pointer;
}
.dk-kosoa-panel__btn:hover {
  background: var(--lav-purple-tint);
}
