/* TerDzö dictionary widget: the search and the whole word page, for any site (terdzo.js).
   Every rule is scoped to terdzo-dictionary. A site matches its own look by setting the --tz-* properties
   on the element; the defaults are TermaFoundry's Workshop look. The site loads the Tibetan font itself
   (an @font-face for the family named in --tz-bo-font). */
terdzo-dictionary {
  --tz-surface: #ffffff; --tz-surface2: #efefec; --tz-border: #dddcd6; --tz-rule: #0c0c0c;
  --tz-ink: #0c0c0c; --tz-text2: #262626; --tz-muted: #626262;
  --tz-spoken: #1f4bff; --tz-written: #b8860b; --tz-dharma: #157a3c; --tz-root: #e3241b;
  --tz-good: #157a3c; --tz-bad: #e3241b;
  --tz-button: #0c0c0c; --tz-button-text: #ffffff;
  --tz-font: inherit; --tz-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --tz-bo-font: 'Noto Serif Tibetan', 'Jomolhari', 'Microsoft Himalaya', serif;
  --tz-radius: 30px; --tz-radius-sm: 16px;
  --tz-sp-soft: color-mix(in srgb, var(--tz-spoken) 9%, var(--tz-surface));
  --tz-wr-soft: color-mix(in srgb, var(--tz-written) 12%, var(--tz-surface));
  --tz-dh-soft: color-mix(in srgb, var(--tz-dharma) 9%, var(--tz-surface));
  --tz-rt-soft: color-mix(in srgb, var(--tz-root) 8%, var(--tz-surface));
  display: block; color: var(--tz-ink); font-family: var(--tz-font); font-size: 16px; line-height: 1.5;
}
terdzo-dictionary *, terdzo-dictionary *::before, terdzo-dictionary *::after { box-sizing: border-box; }
terdzo-dictionary [hidden] { display: none !important; }
terdzo-dictionary :is(h2, h3, h4, p, ol, ul, dl, dd, figure) { margin: 0; }
terdzo-dictionary button { font: inherit; color: inherit; }

/* Tibetan: its own font, room above and below for vowels and stacks, never clipped */
terdzo-dictionary .tz-bo { font-family: var(--tz-bo-font); line-height: 1.9; }
terdzo-dictionary .tz-ibo { font-family: var(--tz-bo-font); font-size: 1.3em; line-height: 1; vertical-align: -0.08em; }
terdzo-dictionary [data-look] { cursor: pointer; }
terdzo-dictionary [data-look]:hover { text-decoration: underline; text-decoration-color: var(--tz-border); text-underline-offset: 4px; }
terdzo-dictionary .tz-mono { font-family: var(--tz-mono); font-variant-numeric: tabular-nums; }
terdzo-dictionary .tz-note { font-size: 14px; line-height: 1.55; color: var(--tz-muted); }
terdzo-dictionary .tz-label { font: 12px var(--tz-mono); color: var(--tz-muted); }

/* search */
terdzo-dictionary .tz-form { display: flex; gap: 10px; max-width: 760px; }
terdzo-dictionary .tz-input-wrap { position: relative; flex: 1; min-width: 0; }
terdzo-dictionary .tz-input { width: 100%; padding: 12px 44px 12px 18px; border: 1px solid var(--tz-rule); border-radius: 999px; background: var(--tz-surface); color: var(--tz-ink); font: 17px/1.8 var(--tz-font); font-family: var(--tz-font), var(--tz-bo-font); outline: none; }
terdzo-dictionary .tz-input.tz-bo-in { font-size: 23px; line-height: 1.6; padding-top: 8px; padding-bottom: 8px; }   /* Tibetan typed in: its own size */
terdzo-dictionary .tz-input:focus { box-shadow: 0 0 0 3px var(--tz-surface2); }
terdzo-dictionary .tz-input::placeholder { color: var(--tz-muted); }
terdzo-dictionary .tz-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--tz-muted); display: flex; padding: 4px; }
terdzo-dictionary .tz-submit { padding: 12px 26px; font-size: 16px; font-weight: 700; border-radius: 999px; border: 1px solid var(--tz-button); background: var(--tz-button); color: var(--tz-button-text); cursor: pointer; }
terdzo-dictionary .tz-online { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font: 12px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--tz-muted); }
terdzo-dictionary .tz-online.on i { background: var(--tz-good); } terdzo-dictionary .tz-online.off i { background: var(--tz-bad); }
terdzo-dictionary .tz-state { padding: 16px 0 0; color: var(--tz-muted); font-size: 15px; }
terdzo-dictionary .tz-state.error { color: var(--tz-bad); }
terdzo-dictionary .tz-out { margin-top: 26px; }
terdzo-dictionary .tz-notice { font-size: 13px; color: var(--tz-muted); margin-bottom: 18px; }

/* two columns, like a printed dictionary: the entry, and beside it the other matches and quick facts */
terdzo-dictionary .tz-layout { display: grid; grid-template-columns: minmax(0, 880px) minmax(260px, 340px); justify-content: space-between; gap: 0 56px; align-items: start; }
terdzo-dictionary .tz-page, terdzo-dictionary .tz-side { min-width: 0; }
terdzo-dictionary .tz-side { display: grid; gap: 0; }

/* other words */
terdzo-dictionary .tz-others { border-top: 2px solid var(--tz-rule); padding: 14px 0 22px; display: grid; gap: 4px; }
terdzo-dictionary .tz-others h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; }
terdzo-dictionary .tz-others ul { list-style: none; padding: 0; display: grid; }
terdzo-dictionary .tz-other { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--tz-border); padding: 4px 6px 6px; cursor: pointer; border-radius: 6px; }
terdzo-dictionary .tz-other:hover { background: var(--tz-surface2); }
terdzo-dictionary .tz-other .tz-bo { font-size: 22px; line-height: 1.65; }
terdzo-dictionary .tz-other .w { font: 13px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-other .g { font-size: 14px; color: var(--tz-text2); flex: 1 0 100%; min-width: 0; line-height: 1.35; }

/* the word page: the entry's head */
terdzo-dictionary .tz-head { border-top: 2px solid var(--tz-rule); padding: 6px 0 18px; }
terdzo-dictionary .tz-word { font-family: var(--tz-bo-font); font-weight: 400; font-size: clamp(54px, 8vw, 84px); line-height: 1.5; }
terdzo-dictionary .tz-pron { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; font-size: 17px; }
terdzo-dictionary .tz-pron .wy { font: 18px var(--tz-mono); }
terdzo-dictionary .tz-pron .ls { font: 16px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-pron .pos { font-style: italic; color: var(--tz-text2); }
terdzo-dictionary .tz-freq { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; color: var(--tz-muted); }
terdzo-dictionary .tz-freq i { width: 8px; height: 8px; border-radius: 50%; background: var(--tz-border); }
terdzo-dictionary .tz-freq i.on { background: var(--tz-ink); }
terdzo-dictionary .tz-freq span { margin-left: 6px; }

/* the jump bar: stays in view under the site's own sticky header (--tz-sticky-top) */
terdzo-dictionary .tz-nav { position: sticky; top: var(--tz-sticky-top, 0px); z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px 0; margin-bottom: 4px; background: var(--tz-page, var(--tz-surface)); border-top: 1px solid var(--tz-border); border-bottom: 1px solid var(--tz-rule); }
terdzo-dictionary .tz-nav::-webkit-scrollbar { display: none; }
terdzo-dictionary .tz-nav button { flex: none; background: none; border: 0; border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 600; color: var(--tz-muted); cursor: pointer; white-space: nowrap; }
terdzo-dictionary .tz-nav button:hover { color: var(--tz-ink); background: var(--tz-surface2); }
terdzo-dictionary .tz-nav button.on { color: var(--tz-button-text); background: var(--tz-button); }
terdzo-dictionary .tz-group { scroll-margin-top: calc(var(--tz-sticky-top, 0px) + 48px); }   /* lands its top rule under the bar's */

/* sections: a heading and a rule, no boxes */
terdzo-dictionary .tz-sec { border-top: 1px solid var(--tz-border); padding: 24px 0 28px; display: grid; gap: 14px; align-content: start; min-width: 0; }
terdzo-dictionary .tz-sec > h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
terdzo-dictionary .tz-sec > h3 .tz-label { font-weight: 400; letter-spacing: 0; }
terdzo-dictionary .tz-side .tz-sec { padding: 16px 0 22px; gap: 10px; }
terdzo-dictionary .tz-side .tz-sec > h3 { font-size: 16px; letter-spacing: -.01em; }
terdzo-dictionary .tz-side .tz-sidefacts > .tz-sec:first-child { border-top: 2px solid var(--tz-rule); }
terdzo-dictionary .tz-side .tz-others:not([hidden]) + .tz-sidefacts > .tz-sec:first-child { border-top: 1px solid var(--tz-border); }
terdzo-dictionary .tz-claim { font-size: 15px; font-weight: 700; line-height: 1.4; }
terdzo-dictionary .tz-meter { display: grid; gap: 8px; }
terdzo-dictionary .tz-mrow { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
terdzo-dictionary .tz-track { height: 10px; background: var(--tz-surface2); border-radius: 999px; overflow: hidden; }
terdzo-dictionary .tz-fill { height: 100%; border-radius: 999px; }
terdzo-dictionary .tz-v { text-align: right; font: 12px var(--tz-mono); white-space: nowrap; }
terdzo-dictionary h4 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }

terdzo-dictionary .tz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
terdzo-dictionary .tz-chip { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; border: 1px solid var(--tz-border); border-radius: 14px; padding: 3px 12px; background: var(--tz-surface); max-width: 100%; }
terdzo-dictionary .tz-chip .tz-bo { font-size: 20px; }
terdzo-dictionary .tz-chip .g { font-size: 14px; color: var(--tz-text2); }
terdzo-dictionary .tz-tag { font: 12px var(--tz-mono); border-radius: 999px; padding: 2px 9px; border: 1px solid var(--tz-border); color: var(--tz-text2); white-space: nowrap; }
terdzo-dictionary .tz-tag.colloquial { color: var(--tz-spoken); border-color: currentColor; background: var(--tz-sp-soft); }
terdzo-dictionary .tz-tag.literary { color: var(--tz-written); border-color: currentColor; background: var(--tz-wr-soft); }
terdzo-dictionary .tz-tag.dharma, terdzo-dictionary .tz-tag.classical { color: var(--tz-dharma); border-color: currentColor; background: var(--tz-dh-soft); }

/* the definitions */
terdzo-dictionary .tz-defs { border-top: 0; padding-top: 18px; gap: 22px; }
terdzo-dictionary .tz-senses { padding-left: 1.7em; display: grid; gap: 26px; list-style: decimal outside; }
terdzo-dictionary .tz-senses.single { list-style: none; padding-left: 0; }
terdzo-dictionary .tz-senses > li { padding-left: 4px; }
terdzo-dictionary .tz-senses > li::marker { font-weight: 800; font-size: 18px; }
terdzo-dictionary .tz-def { font-size: 19px; line-height: 1.55; overflow-wrap: anywhere; }
terdzo-dictionary .tz-reg { font-style: italic; font-size: 15px; color: var(--tz-muted); margin-right: 8px; }
terdzo-dictionary .tz-reg.colloquial, terdzo-dictionary .tz-reg.spoken { color: var(--tz-spoken); }
terdzo-dictionary .tz-reg.literary, terdzo-dictionary .tz-reg.written { color: var(--tz-written); }
terdzo-dictionary .tz-reg.dharma, terdzo-dictionary .tz-reg.classical { color: var(--tz-dharma); }
terdzo-dictionary .tz-sub { margin-top: 10px; }
terdzo-dictionary .tz-lab { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tz-muted); margin-right: 10px; }
terdzo-dictionary .tz-line .tz-ibo { font-size: 1.35em; }
terdzo-dictionary .tz-sep { color: var(--tz-muted); }
terdzo-dictionary .tz-bodef { display: grid; gap: 2px; }
terdzo-dictionary .tz-ex { list-style: none; margin-top: 12px; padding: 2px 0 2px 16px; border-left: 2px solid var(--tz-border); display: grid; gap: 10px; }
terdzo-dictionary .tz-ex-bo { display: block; font-family: var(--tz-bo-font); font-size: 21px; line-height: 1.85; cursor: pointer; }
terdzo-dictionary .tz-ex-en { display: block; font-size: 15px; line-height: 1.5; color: var(--tz-text2); font-style: italic; }
terdzo-dictionary .tz-mt { font: 11px var(--tz-mono); color: var(--tz-muted); font-style: normal; white-space: nowrap; }
terdzo-dictionary .tz-bodef-bo { display: block; font-family: var(--tz-bo-font); font-size: 20px; line-height: 1.85; cursor: pointer; }
terdzo-dictionary .tz-forms ul { list-style: none; padding: 0; margin-top: 6px; display: grid; gap: 2px; }
terdzo-dictionary .tz-forms li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
terdzo-dictionary .tz-forms li .tz-lab { min-width: 130px; margin-right: 0; }
terdzo-dictionary .tz-forms li .tz-ibo { font-size: 1.5em; line-height: 1.6; }
terdzo-dictionary .tz-forms li .t { color: var(--tz-text2); font-size: 15px; }

/* the spelling chant */
terdzo-dictionary .tz-chant { display: grid; gap: 14px; }
terdzo-dictionary .tz-csyl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; border: 1px solid var(--tz-border); border-radius: 20px; padding: 14px 16px; }
terdzo-dictionary .tz-cglyph { display: grid; justify-items: center; gap: 2px; }
terdzo-dictionary .tz-cglyph .big { font-family: var(--tz-bo-font); font-size: 60px; line-height: 1.45; min-height: 87px; }
terdzo-dictionary .tz-cglyph .ph { font: 16px var(--tz-mono); color: var(--tz-spoken); min-height: 20px; }
terdzo-dictionary .tz-cline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
terdzo-dictionary .tz-piece { display: inline-grid; justify-items: center; border: 1px solid var(--tz-border); border-radius: 12px; padding: 3px 10px 5px; background: var(--tz-surface); cursor: pointer; transition: background .25s, border-color .25s, transform .25s, opacity .25s; }
terdzo-dictionary .tz-piece .pb { font-family: var(--tz-bo-font); font-size: 20px; line-height: 1.7; }
terdzo-dictionary .tz-piece .pr { font: 12px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-piece.root { border-color: var(--tz-root); } terdzo-dictionary .tz-piece.root .pb { color: var(--tz-root); }
terdzo-dictionary .tz-piece.now { background: var(--tz-sp-soft); border-color: var(--tz-spoken); transform: translateY(-2px); }
terdzo-dictionary .tz-piece.off, terdzo-dictionary .tz-eq.off { opacity: .3; }
terdzo-dictionary .tz-eq { font: 14px var(--tz-mono); color: var(--tz-spoken); transition: opacity .25s; }
terdzo-dictionary .tz-dot { color: var(--tz-muted); }
terdzo-dictionary .tz-does { font-size: 15px; min-height: 24px; margin-top: 8px; color: var(--tz-text2); }
terdzo-dictionary .tz-slots { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
terdzo-dictionary .tz-slot { border-radius: 8px; padding: 4px 2px; text-align: center; background: var(--tz-surface2); display: grid; }
terdzo-dictionary .tz-slot .ch { font-family: var(--tz-bo-font); font-size: 19px; line-height: 1.6; min-height: 30px; }
terdzo-dictionary .tz-slot .nm { font: 11px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-slot.full { background: var(--tz-sp-soft); } terdzo-dictionary .tz-slot.full .ch { color: var(--tz-spoken); }
terdzo-dictionary .tz-slot.r { background: var(--tz-rt-soft); } terdzo-dictionary .tz-slot.r .ch { color: var(--tz-root); }
terdzo-dictionary .tz-slot.lit { box-shadow: 0 0 0 1.5px var(--tz-spoken) inset; }
terdzo-dictionary .tz-ctrl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
terdzo-dictionary .tz-btn { font-weight: 600; font-size: 14px; color: var(--tz-ink); background: var(--tz-surface); border: 1px solid var(--tz-ink); border-radius: 999px; padding: 7px 15px; cursor: pointer; }
terdzo-dictionary .tz-btn:hover { background: var(--tz-ink); color: var(--tz-surface); }

/* rows: same sound, family, respect, stems */
terdzo-dictionary .tz-rows { display: grid; gap: 12px; }
terdzo-dictionary .tz-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: start; }
terdzo-dictionary .tz-key { text-align: center; border-radius: var(--tz-radius-sm); padding: 6px 4px 8px; background: var(--tz-rt-soft); }
terdzo-dictionary .tz-key .tz-bo { font-size: 30px; line-height: 1.6; color: var(--tz-root); display: block; }
terdzo-dictionary .tz-key .g { font-size: 13px; color: var(--tz-text2); }
terdzo-dictionary .tz-key.sound { background: none; border: 1px solid var(--tz-spoken); }
terdzo-dictionary .tz-key.sound .tz-bo { color: var(--tz-ink); }
terdzo-dictionary .tz-key .s { font: 14px var(--tz-mono); color: var(--tz-spoken); }
terdzo-dictionary .tz-rung { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 14px; border-radius: var(--tz-radius-sm); border: 1px solid var(--tz-border); }
terdzo-dictionary .tz-rung .tz-bo { font-size: 25px; }
terdzo-dictionary .tz-rung .who { font-size: 15px; color: var(--tz-text2); }
terdzo-dictionary .tz-rung .n { font: 13px var(--tz-mono); color: var(--tz-muted); text-align: right; }
terdzo-dictionary .tz-side .tz-rows { gap: 0; }
terdzo-dictionary .tz-side .tz-rung { grid-template-columns: max-content minmax(0, 1fr) auto; gap: 0 10px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--tz-border); border-radius: 6px; }
terdzo-dictionary .tz-side .tz-rung .tz-bo { font-size: 22px; line-height: 1.75; }
terdzo-dictionary .tz-side .tz-rung .who { font-size: 14px; line-height: 1.35; }
terdzo-dictionary .tz-side .tz-rung .n { font-size: 12px; }
terdzo-dictionary .tz-side .tz-rung.here { border-color: var(--tz-border); }
terdzo-dictionary .tz-rung.here { border-color: var(--tz-spoken); background: var(--tz-sp-soft); }
terdzo-dictionary .tz-stems { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
terdzo-dictionary .tz-stem { border: 1px solid var(--tz-border); border-radius: var(--tz-radius-sm); padding: 8px; text-align: center; }
terdzo-dictionary .tz-stem .tz-bo { font-size: 27px; display: block; }
terdzo-dictionary .tz-vsense { border: 1px solid var(--tz-border); border-radius: var(--tz-radius-sm); padding: 10px 14px; display: grid; gap: 8px; }
terdzo-dictionary .tz-vsense.this { border-color: var(--tz-spoken); }
terdzo-dictionary .tz-vsense:not(.this) { opacity: .75; }
terdzo-dictionary .tz-vs-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
terdzo-dictionary .tz-vs-head .tz-bo { font-size: 22px; }
terdzo-dictionary .tz-fr { cursor: help; border-bottom: 1px dotted var(--tz-muted); }

/* particles */
terdzo-dictionary .tz-plist { display: grid; }
terdzo-dictionary .tz-prow { display: grid; grid-template-columns: 150px minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--tz-border); }
terdzo-dictionary .tz-prow .tz-bo { font-size: 23px; }
terdzo-dictionary .tz-pk { display: grid; } terdzo-dictionary .tz-pk .tz-bo { font-size: 17px; color: var(--tz-text2); }
terdzo-dictionary .tz-pbars { display: grid; gap: 5px; }
terdzo-dictionary .tz-pbar { display: grid; grid-template-columns: 62px minmax(0, 1fr) 50px; gap: 8px; align-items: center; font: 12px var(--tz-mono); }
terdzo-dictionary .tz-pbar .tz-track { height: 8px; }
terdzo-dictionary details.tz-more > summary { cursor: pointer; font-size: 15px; color: var(--tz-text2); padding: 8px 0; }

/* next words */
terdzo-dictionary .tz-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
terdzo-dictionary .tz-box { border-radius: 20px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; border: 1px solid var(--tz-border); }
terdzo-dictionary .tz-box.spoken { border-top: 3px solid var(--tz-spoken); } terdzo-dictionary .tz-box.written { border-top: 3px solid var(--tz-written); }
terdzo-dictionary .tz-box h4 { display: flex; gap: 10px; align-items: baseline; }
terdzo-dictionary .tz-bar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 52px; gap: 10px; align-items: center; border-radius: 8px; padding: 0 6px; }
terdzo-dictionary .tz-bar .tz-bo { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: .15em; }
terdzo-dictionary .tz-bar.hi { background: var(--tz-wr-soft); }
terdzo-dictionary .tz-signals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
terdzo-dictionary .tz-sig { border: 1px dashed var(--tz-border); border-radius: 14px; padding: 6px 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; cursor: pointer; background: none; text-align: left; }
terdzo-dictionary .tz-sig:hover, terdzo-dictionary .tz-sig.on { border-style: solid; border-color: var(--tz-written); }
terdzo-dictionary .tz-sig .tz-bo { font-size: 20px; }

/* through time */
terdzo-dictionary .tz-time svg { width: 100%; height: auto; display: block; }
terdzo-dictionary .tz-readout { font-size: 15px; min-height: 22px; color: var(--tz-text2); }

/* sanskrit */
terdzo-dictionary .tz-equation { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
terdzo-dictionary .tz-part { border: 1px solid var(--tz-dharma); border-radius: 18px; padding: 8px 16px 12px; display: grid; gap: 2px; justify-items: center; background: var(--tz-dh-soft); min-width: 120px; }
terdzo-dictionary .tz-part .tz-bo { font-size: 30px; }
terdzo-dictionary .tz-part .skt { font: 16px var(--tz-mono); color: var(--tz-dharma); }
terdzo-dictionary .tz-part .g { font-size: 14px; color: var(--tz-text2); text-align: center; max-width: 230px; }
terdzo-dictionary .tz-part.total { background: var(--tz-surface); border-width: 2px; }
terdzo-dictionary .tz-op { align-self: center; font: 22px var(--tz-mono); color: var(--tz-muted); }

/* sentence builder */
terdzo-dictionary .tz-sentence { font-family: var(--tz-bo-font); font-size: 30px; line-height: 1.9; min-height: 58px; display: flex; flex-wrap: wrap; gap: 0 2px; align-items: baseline; }
terdzo-dictionary .tz-sentence span { border-bottom: 2px solid var(--tz-spoken); padding: 0 1px; }
terdzo-dictionary .tz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
terdzo-dictionary .tz-opt { display: inline-flex; align-items: baseline; gap: 8px; border: 1px solid var(--tz-spoken); border-radius: 999px; padding: 2px 14px; background: var(--tz-surface); cursor: pointer; }
terdzo-dictionary .tz-opt .tz-bo { font-size: 21px; }
terdzo-dictionary .tz-opt .p { font: 12px var(--tz-mono); color: var(--tz-muted); }
terdzo-dictionary .tz-opt:hover { background: var(--tz-sp-soft); }

/* phrases, one to a line, in two columns where there is room */
terdzo-dictionary .tz-phr { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
terdzo-dictionary .tz-phr li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; padding: 4px 0; border-bottom: 1px solid var(--tz-border); }
terdzo-dictionary .tz-phr .tz-bo { font-size: 22px; line-height: 1.7; }
terdzo-dictionary .tz-phr .g { font-size: 15px; color: var(--tz-text2); }
@media (max-width: 700px) { terdzo-dictionary .tz-phr { grid-template-columns: minmax(0, 1fr); } }

/* examples in use */
terdzo-dictionary .tz-exlist { display: grid; gap: 12px; }
terdzo-dictionary .tz-exrow { border-left: 3px solid var(--tz-spoken); padding-left: 14px; }
terdzo-dictionary .tz-exrow.written { border-left-color: var(--tz-written); }

@media (max-width: 1020px) {
  terdzo-dictionary .tz-layout { grid-template-columns: minmax(0, 1fr); }
  terdzo-dictionary .tz-side { margin-top: 8px; }
}
@media (max-width: 860px) {
  terdzo-dictionary :is(.tz-compare, .tz-signals) { grid-template-columns: minmax(0, 1fr); }
  terdzo-dictionary .tz-prow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (max-width: 560px) {
  terdzo-dictionary .tz-form { flex-direction: column; }
  terdzo-dictionary .tz-def { font-size: 18px; }
  terdzo-dictionary .tz-csyl { grid-template-columns: minmax(0, 1fr); }
  terdzo-dictionary .tz-stems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  terdzo-dictionary .tz-rung { grid-template-columns: 96px minmax(0, 1fr); }
  terdzo-dictionary .tz-rung .n { grid-column: 2; text-align: left; }
  terdzo-dictionary .tz-row { grid-template-columns: minmax(0, 1fr); }
  terdzo-dictionary .tz-key { justify-self: start; padding: 4px 16px 6px; }
  terdzo-dictionary .tz-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  terdzo-dictionary .tz-bar { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 48px; }
  terdzo-dictionary .tz-forms li .tz-lab { min-width: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { terdzo-dictionary * { transition: none !important; } }
