/* TH Members: uses the theme's palette and fonts (theme.json presets). */
.thm { --thm-line: var(--wp--preset--color--limestone); font-family: var(--wp--preset--font-family--sans); color: var(--wp--preset--color--ink); }
.thm h2, .thm h3 { font-family: var(--wp--preset--font-family--display); font-weight: 600; line-height: 1.15; margin: .2em 0 .5em; }
.thm h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.thm h3 { font-size: 1.35rem; }
.thm a { color: var(--wp--preset--color--bronze); text-underline-offset: 3px; }
.thm a:focus-visible, .thm button:focus-visible, .thm input:focus-visible, .thm select:focus-visible { outline: 3px solid var(--wp--preset--color--bronze); outline-offset: 2px; }
.thm .wp-element-button, .thm button.wp-element-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; color: var(--wp--preset--color--white); }
.thm .thm-btn.is-ghost { background: transparent; color: var(--wp--preset--color--bronze); }
.thm .thm-btn.is-ghost:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }
.thm-notice { border-left: 4px solid var(--wp--preset--color--bronze); background: var(--wp--preset--color--white); padding: .8rem 1rem; margin: 0 0 1.5rem; }
.thm-notice.is-error { border-left-color: #9B2C1F; }
.thm-card, .thm-plan, .thm-cta { background: var(--wp--preset--color--white); border: 1px solid var(--thm-line); padding: 1.5rem; }
.thm-cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1.5rem; }
.thm-plan { margin: 1.5rem 0; border-top: 4px solid var(--wp--preset--color--gold); }
.thm-price { font-family: var(--wp--preset--font-family--display); font-size: 2.2rem; font-weight: 600; margin: 0 0 .5rem; }
.thm-benefits { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.thm-form label, .thm-card form label, .thm-search label { display: block; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--graphite); margin-bottom: .3rem; }
.thm input[type=email], .thm input[type=password], .thm input[type=text], .thm input[type=search], .thm input[type=number], .thm select {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--wp--preset--color--graphite); border-radius: 0; background: var(--wp--preset--color--white); font: inherit; color: inherit; }
.thm #thm-login .login-remember label { display: inline; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 1rem; }
.thm #thm-login .button, .thm #thm-login input[type=submit] { min-height: 44px; padding: .95rem 1.4rem; border: 1px solid var(--wp--preset--color--bronze); background: var(--wp--preset--color--bronze); color: var(--wp--preset--color--white); font-family: var(--wp--preset--font-family--sans); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.thm-help { display: block; font-size: .85rem; color: var(--wp--preset--color--graphite); margin-top: .3rem; }
.thm-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thm-testflag { background: var(--wp--preset--color--stone); padding: .7rem .9rem; }
.thm-link-btn { background: none; border: 0; padding: 0; color: var(--wp--preset--color--bronze); text-decoration: underline; font: inherit; cursor: pointer; min-height: 44px; }

/* Database */
.thm-intro, .thm-status { color: var(--wp--preset--color--graphite); margin: .3rem 0; }
.thm-search { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; background: var(--wp--preset--color--stone); padding: 1.2rem; margin: 1.5rem 0 1rem; }
.thm-search p { margin: 0; }
.thm-field-wide { grid-column: span 2; }
.thm-field-go { display: flex; gap: 1rem; align-items: center; }
.thm-count { font-weight: 600; margin: .5rem 0; }
.thm-table-wrap { overflow-x: auto; border: 1px solid var(--thm-line); background: var(--wp--preset--color--white); }
.thm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.thm-table th, .thm-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--thm-line); vertical-align: top; }
.thm-table thead th { background: var(--wp--preset--color--night); color: var(--wp--preset--color--stone); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.thm-table thead th a { color: inherit; text-decoration: none; display: inline-block; min-height: 24px; }
.thm-table thead th a:hover, .thm-table thead th a:focus-visible { text-decoration: underline; outline-color: var(--wp--preset--color--gold); }
.thm-table tbody tr:nth-child(even) { background: var(--wp--preset--color--stone); }
.thm-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 600; white-space: nowrap; }
.thm-legend { font-variant: small-caps; letter-spacing: .03em; }
.thm-locked td { filter: blur(5px); user-select: none; color: var(--wp--preset--color--graphite); }
.thm-cta { text-align: center; border-top: 4px solid var(--wp--preset--color--gold); margin: -1px 0 1.5rem; box-shadow: 0 -2.5rem 2.5rem -1rem rgba(244, 239, 230, .9); position: relative; }
.thm-cta-btns { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.thm-pagerwrap { margin: 1.2rem 0; }
.thm-showing { margin: 0 0 .5rem; color: var(--wp--preset--color--graphite); }
.thm-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; }
.thm-pager ul { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.thm-pager li > a, .thm-pager li > span { display: inline-flex; min-width: 44px; min-height: 44px; padding: 0 .6rem; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid var(--thm-line); text-decoration: none; background: var(--wp--preset--color--white); color: inherit; }
.thm-pager li > a:hover { border-color: var(--wp--preset--color--ink); }
.thm-pager li > a:focus-visible, .thm-goto input:focus-visible, .thm-goto button:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 2px; }
.thm-pager a[aria-current] { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--stone); border-color: var(--wp--preset--color--ink); font-weight: 600; }
.thm-pager .is-off { color: var(--wp--preset--color--graphite); background: transparent; border-style: dashed; }
.thm-pager .thm-pg-gap > span { border: 0; background: transparent; min-width: 1.5rem; padding: 0; }
.thm-pager .thm-pg-status { display: none; }
.thm-goto { display: flex; align-items: center; gap: .4rem; margin: 0; flex-wrap: wrap; }
.thm .thm-goto input[type=number] { width: 5.5rem; max-width: 5.5rem; flex: 0 0 auto; min-height: 44px; box-sizing: border-box; padding: 0 .5rem; border: 1px solid var(--wp--preset--color--graphite); font: inherit; }
.thm-goto button { min-height: 44px; min-width: 44px; padding: 0 1rem; border: 1px solid var(--wp--preset--color--ink); background: var(--wp--preset--color--ink); color: var(--wp--preset--color--stone); font: inherit; cursor: pointer; }
@media (max-width: 640px) {
	.thm-pager .thm-pg-num, .thm-pager .thm-pg-gap { display: none; }
	.thm-pager .thm-pg-status { display: inline-flex; min-height: 44px; align-items: center; padding: 0 .5rem; font-weight: 600; }
	.thm-pager ul { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
}
.thm-sources-link { margin: 2.5rem 0 0; font-size: .8rem; }
.thm .thm-sources-link a { color: var(--wp--preset--color--graphite); }
.thm .thm-sources-link a:hover { color: var(--wp--preset--color--ink); }
.thm-source-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.thm-source { background: var(--wp--preset--color--white); border: 1px solid var(--thm-line); padding: 1.2rem 1.5rem; margin-bottom: 1rem; }
.thm-source h2 { font-size: 1.4rem; }
.thm-source-k { font-weight: 600; }
.thm-source-note { color: var(--wp--preset--color--graphite); }

/* Record */
.thm-record { background: var(--wp--preset--color--white); border: 1px solid var(--thm-line); padding: 1.5rem; margin-bottom: 1.5rem; }
.thm-record .thm-code { font-size: 1rem; }
.thm-rec-head { margin: 0 0 .75rem; }
.thm-cfm-head { font-size: 2.2rem; line-height: 1.15; margin: 0 0 .25rem; font-variant-numeric: lining-nums tabular-nums; }
.thm-also { margin: 0 0 .5rem; font-size: 1.05rem; }
.thm-also-ref { font-style: italic; }
.thm-code-line { margin: 0; }
.thm-code-k { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-right: .25rem; }
.thm-cfm { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thm-table .thm-sub { display: block; font-size: .8rem; font-weight: 400; margin-top: .15rem; }
.thm-nomisma { font-size: .8rem; margin-left: .35rem; padding: .1rem .2rem; text-transform: lowercase; letter-spacing: .02em; }
.thm-links-credit { font-size: .85rem; margin-top: 1.5rem; }
.thm-blocks td, .thm-blocks th { font-variant-numeric: tabular-nums; }
.thm-blocks .thm-reserve td { font-style: italic; }
.thm-side { border-top: 1px solid var(--thm-line); padding-top: 1rem; margin-top: 1rem; }
.thm-side dl { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: .45rem 1.2rem; margin: 0; }
.thm-side dt { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--graphite); padding-top: .15rem; }
.thm-side dd { margin: 0; }
.thm-side dd.thm-legend { font-size: 1.15rem; }
.thm-trap { background: var(--wp--preset--color--stone); border-left: 4px solid var(--wp--preset--color--gold); padding: .8rem 1rem; margin-top: 1.2rem; }
.thm-trap p { margin: .2rem 0; }

@media (max-width: 900px) { .thm-search { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones: each coin becomes a labeled card. */
@media (max-width: 720px) {
  .thm-search { grid-template-columns: 1fr 1fr; }
  .thm-field-wide, .thm-field-go { grid-column: 1 / -1; }
  .thm-table-wrap { border: 0; background: none; overflow: visible; }
  .thm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .thm-table, .thm-table tbody, .thm-table tr, .thm-table td { display: block; width: 100%; box-sizing: border-box; }
  .thm-table tr { background: var(--wp--preset--color--white) !important; border: 1px solid var(--thm-line); margin-bottom: .8rem; padding: .4rem 0; }
  .thm-table td { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; border: 0; padding: .3rem .8rem; }
  .thm-table td::before { content: attr(data-label); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--graphite); }
  .thm-locked td::before { content: ""; }
  .thm-locked ~ .thm-locked ~ .thm-locked { display: none; }
  .thm-side dl { grid-template-columns: 1fr; gap: .15rem; }
  .thm-side dd { margin-bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .thm * { transition: none !important; } }
/* The page template keeps content at 720px; let the database break out to the theme's wide size. */
.thm-db.alignwide { --thm-w: min(var(--wp--style--global--wide-size, 1240px), calc(100vw - 2.5rem)); width: var(--thm-w); max-width: none !important; margin-left: calc((100% - var(--thm-w)) / 2) !important; margin-right: 0 !important; }
/* Database page: the title lines up with the wide content below it. */
body.thm-wide-page main > .th-section:has(> .wp-block-post-title), body.thm-wide-page .wp-block-post-title { max-width: min(var(--wp--style--global--wide-size, 1240px), calc(100vw - 2.5rem)) !important; }
/* Year with a BC/AD choice */
.thm-yr { display: flex; gap: .4rem; }
.thm-yr input { flex: 1 1 auto; min-width: 0; }
.thm-yr select { flex: 0 0 5rem; width: 5rem; }
.thm-span { font-weight: 400; color: var(--wp--preset--color--graphite); }
/* Kharoshthi (Indo-Greek legends): self-hosted Noto Sans Kharoshthi, SIL Open Font License (assets/fonts). Loads only when Kharoshthi text is on the page. */
@font-face { font-family: "Noto Sans Kharoshthi"; src: url("fonts/noto-sans-kharoshthi-kharoshthi-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+10A00-10A5F; }
.thm [lang="pra-Khar"] { font-family: "Noto Sans Kharoshthi", var(--wp--preset--font-family--sans); font-variant: normal; letter-spacing: 0; font-size: 1.1em; unicode-bidi: isolate; }
/* Code key */
.thm-code-row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.thm .thm-help { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; font-size: .85rem; color: var(--wp--preset--color--graphite); }
.thm-help-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border: 1px solid currentColor; border-radius: 50%; font-weight: 600; font-size: .8rem; line-height: 1; }
.thm-breakdown { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; padding: 0; }
.thm-breakdown > div { background: var(--wp--preset--color--stone); border: 1px solid var(--thm-line); padding: .35rem .6rem; }
.thm-breakdown dt { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 600; display: inline; margin-right: .4rem; }
.thm-breakdown dd { display: inline; margin: 0; font-size: .9rem; }
.thm-bd-note { color: var(--wp--preset--color--graphite); }
.thm-jump { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: 1.5rem; }
.thm-jump a { display: inline-flex; min-height: 44px; align-items: center; }
.thm-example { background: var(--wp--preset--color--white); border: 1px solid var(--thm-line); padding: 1.2rem 1.5rem; margin: 1rem 0; }
.thm-example-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 600; margin: 0 0 .8rem; }
.thm-tip { background: var(--wp--preset--color--stone); border-left: 4px solid var(--wp--preset--color--gold); padding: .7rem 1rem; }
.thm-key-table th[scope=row] { white-space: nowrap; }
.thm-key-list { margin: 0; padding-left: 1rem; }
.thm-key-series { color: var(--wp--preset--color--graphite); }
.thm-muted { color: var(--wp--preset--color--graphite); }
.thm-codekey h3 { margin-top: 1.5rem; }
:target { scroll-margin-top: 1rem; }
/* Hidden test preview bar (administrators only) */
.thm-previewbar { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); padding: .7rem 1rem; margin: 0 0 1.5rem; font-size: .9rem; }
.thm-previewbar p { margin: .2rem 0; }
.thm-previewbar a { color: var(--wp--preset--color--white); display: inline-flex; align-items: center; min-height: 44px; margin-right: .8rem; }
.thm-previewbar .thm-pv-cur { margin-right: .8rem; text-decoration: underline; text-decoration-thickness: 2px; }
.thm-pg-prev span[aria-hidden] { margin-right: .35rem; }
.thm-pg-next span[aria-hidden] { margin-left: .35rem; }

.thm-rulers { border: 1px solid currentColor; border-radius: 4px; margin: .5rem 0; padding: 0 .75rem; }
.thm-rulers > summary { cursor: pointer; min-height: 44px; box-sizing: border-box; padding: .65rem 0; font-weight: 600; }
.thm-rulers > summary:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.thm-rulers-n { font-weight: 400; font-size: .9rem; margin-left: .5rem; }
.thm-rulers[open] > summary { margin-bottom: .5rem; }
.thm-table-wrap[tabindex]:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
/* Sections list on the database page */
.thm-sections { margin: 1rem 0 1.25rem; }
.thm-sections-h { font-size: 1rem; margin: 0 0 .5rem; }
.thm-sections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.thm-sections a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .8rem; border: 1px solid currentColor; border-radius: 4px; text-decoration: none; }
.thm-sections a:hover, .thm-sections a:focus-visible { text-decoration: underline; }
.thm-sections a[aria-current] { font-weight: 700; box-shadow: inset 0 -3px 0 currentColor; }
.thm-sections-n { font-size: .85rem; font-variant-numeric: tabular-nums; }
/* Non-Latin scripts: system fonts that carry them, so legends never fall back to empty boxes */
.thm :lang(zh-Hant), .thm :lang(zh) { font-family: "Noto Serif TC", "Noto Serif CJK TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", "Songti TC", serif; }
.thm :lang(ja-Hani), .thm :lang(ja) { font-family: "Noto Serif JP", "Noto Serif CJK JP", "Noto Sans CJK JP", "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif; }
.thm :lang(ko-Hani), .thm :lang(ko) { font-family: "Noto Serif KR", "Noto Serif CJK KR", "Noto Sans CJK KR", "Batang", "AppleMyungjo", serif; }
.thm :lang(vi-Hani) { font-family: "Noto Serif TC", "Noto Serif CJK TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", serif; }
.thm :lang(hy) { font-family: "Noto Sans Armenian", "Noto Serif Armenian", "Sylfaen", "Mshtakan", sans-serif; }
.thm :lang(mnc) { font-family: "Noto Sans Mongolian", "Mongolian Baiti", sans-serif; }
.thm :lang(zh-Hant), .thm :lang(ja-Hani), .thm :lang(ko-Hani), .thm :lang(vi-Hani) { letter-spacing: .08em; }

/* 0.7.0 teaser for visitors who have not signed up */
.thm-teaser-secs { margin: 2rem 0; }
.thm-sec-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0 2rem; }
.thm-sec-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--thm-line); }
.thm-sec-name { font-weight: 600; }
.thm-sec-n { color: var(--wp--preset--color--graphite); white-space: nowrap; }
.thm-sample { margin: 2rem 0; max-width: 40rem; }
.thm-sample h2 { margin-top: .2rem; }
.thm-teaser-rec { margin-bottom: 1.5rem; }
.thm-teaser-more { max-width: 44rem; }
.thm-teaser-links { margin-top: 1.5rem; }
