/* ===== Font Market — frontend ===== */

/* --- purchase box --- */
.fm-buy { margin: 1.2em 0 1.6em; }
.fm-buy-license { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.fm-buy-field { display: flex; flex-direction: column; gap: 4px; }
.fm-buy-field > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.fm-buy-field select { min-width: 190px; padding: 8px 10px; border: 1px solid #d6d6d6; border-radius: 8px; font: inherit; }

.fm-buy-styles { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid #e2e2e2; border-radius: 12px; overflow: hidden; }
.fm-buy-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid #eee; }
.fm-buy-row:last-child { border-bottom: 0; }
.fm-buy-row:hover { background: #fafafa; }
.fm-style-sample { flex: 1; font-size: 1.35em; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-buy-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fm-buy-btn { white-space: nowrap; }

.fm-buy-family { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid #16181c; border-radius: 12px; }
.fm-buy-family-label { flex: 1; display: flex; flex-direction: column; }
.fm-buy-family-label em { font-style: normal; opacity: .65; font-size: .9em; }
.fm-dual-price .fm-price-sep { opacity: .4; }

@media (max-width: 520px) {
	.fm-buy-row { flex-wrap: wrap; }
	.fm-style-sample { flex-basis: 100%; }
}

/* --- advanced type tester --- */
.fm-tester { margin: 2em 0; border: 1px solid #e4e4e4; border-radius: 14px; overflow: hidden; background: #fff; color: #16181c; }
.fm-tester.fm-dark { background: #131417; color: #f3f3ef; border-color: #26282e; }

.fm-tester-tabs { display: flex; align-items: center; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid #ececec; }
.fm-dark .fm-tester-tabs { border-color: #26282e; }
.fm-tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: inherit; opacity: .6; }
.fm-tab.is-active { opacity: 1; border-bottom-color: currentColor; }
.fm-tabs-spacer { flex: 1; }
.fm-theme-toggle { appearance: none; background: none; border: 1px solid currentColor; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; color: inherit; opacity: .6; line-height: 1; }
.fm-theme-toggle:hover { opacity: 1; }

.fm-tester-toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #ececec; font-size: 13px; }
.fm-dark .fm-tester-toolbar { border-color: #26282e; }
.fm-tool-text { display: flex; gap: 6px; flex: 1 1 280px; min-width: 240px; }
.fm-tester-text { flex: 1; padding: 7px 11px; font: inherit; border: 1px solid #d6d6d6; border-radius: 8px; background: transparent; color: inherit; }
.fm-tester-preset { border: 1px solid #d6d6d6; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; max-width: 110px; }
.fm-dark .fm-tester-text, .fm-dark .fm-tester-preset, .fm-dark .fm-features-pop { border-color: #3a3d45; }
.fm-tool-slider { display: flex; align-items: center; gap: 7px; }
.fm-tool-slider span { opacity: .6; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }
.fm-tool-slider input[type=range] { width: 90px; accent-color: currentColor; }
.fm-tool-slider em { font-style: normal; font-variant-numeric: tabular-nums; min-width: 30px; }
.fm-btn-group { display: inline-flex; border: 1px solid #d6d6d6; border-radius: 8px; overflow: hidden; }
.fm-dark .fm-btn-group { border-color: #3a3d45; }
.fm-btn-group button { appearance: none; border: 0; background: transparent; color: inherit; padding: 6px 11px; cursor: pointer; font: inherit; font-size: 13px; opacity: .55; }
.fm-btn-group button + button { border-left: 1px solid #d6d6d6; }
.fm-dark .fm-btn-group button + button { border-color: #3a3d45; }
.fm-btn-group button.is-active { opacity: 1; background: rgba(127,127,127,.12); font-weight: 700; }
.fm-features { position: relative; }
.fm-features summary { cursor: pointer; list-style: none; padding: 6px 11px; border: 1px solid #d6d6d6; border-radius: 8px; }
.fm-dark .fm-features summary { border-color: #3a3d45; }
.fm-features-pop { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; background: inherit; border: 1px solid #d6d6d6; border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.18); min-width: 230px; background: #fff; }
.fm-dark .fm-features-pop { background: #1b1d22; }
.fm-features-pop label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.fm-features-pop code { margin-left: auto; opacity: .5; font-size: 11px; }

.fm-view { display: none; padding: 6px 16px 16px; }
.fm-view.is-active { display: block; }

.fm-tester-row { padding: 12px 0; border-top: 1px dashed #e8e8e8; }
.fm-dark .fm-tester-row { border-color: #2c2e34; }
.fm-tester-row:first-child { border-top: 0; }
.fm-tester-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin-bottom: 3px; }
.fm-tester-label em { font-style: normal; opacity: .7; }
.fm-tester-sample { font-size: 48px; line-height: 1.15; outline: none; overflow-wrap: anywhere; min-height: 1em; }

.fm-view-style-pick { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 13px; }
.fm-view-style-pick select { border: 1px solid #d6d6d6; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 5px 8px; }
.fm-waterfall-row { display: flex; align-items: baseline; gap: 14px; padding: 6px 0; border-top: 1px dashed #e8e8e8; overflow: hidden; }
.fm-dark .fm-waterfall-row { border-color: #2c2e34; }
.fm-waterfall-row em { font-style: normal; font-size: 11px; opacity: .5; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.fm-waterfall-sample { white-space: nowrap; }

.fm-glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-top: 8px; font-size: 26px; }
.fm-glyph { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid #ececec; border-radius: 8px; }
.fm-dark .fm-glyph { border-color: #2c2e34; }
.fm-glyph:hover { background: rgba(127,127,127,.1); }

/* --- account: licenses --- */
.fm-license-card { border: 1px solid #e2e2e2; border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; }
.fm-download-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* --- font finder --- */
.fm-finder.is-busy { opacity: .7; pointer-events: none; }
.fm-finder-inputs { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 14px 0; }
.fm-finder-drop { display: block; border: 2px dashed #bbb; border-radius: 12px; padding: 26px 34px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.fm-finder-drop.is-over { border-color: #444; background: rgba(127,127,127,.06); }
.fm-finder-drop input { display: none; }
.fm-finder-url-row { display: flex; gap: 8px; flex: 1 1 300px; }
.fm-finder-url { flex: 1; padding: 8px 12px; }
.fm-finder-preview img { max-height: 140px; border-radius: 8px; margin-top: 6px; }
.fm-finder-note { opacity: .8; font-style: italic; }

.fm-match-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 22px; }
.fm-match { display: flex; align-items: center; gap: 14px; border: 1px solid #e2e2e2; border-radius: 12px; padding: 12px 16px; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.fm-match:hover { border-color: #999; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.fm-match-rank { flex: 0 0 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #16181c; color: #fff; font-size: 12px; font-weight: 700; }
.fm-match-body { flex: 1; min-width: 0; }
.fm-match-title { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.fm-match-title em { font-style: normal; }
.fm-match-sample { display: block; font-size: 26px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-match-score { flex: 0 0 110px; text-align: right; }
.fm-match-score i { display: block; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #2e7d32, #66bb6a); margin-bottom: 4px; }
.fm-match-score b { font-size: 13px; font-variant-numeric: tabular-nums; }

.fm-finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.fm-finder-card { display: block; border: 1px solid #e2e2e2; border-radius: 10px; padding: 8px; text-decoration: none; text-align: center; }
.fm-finder-card img { width: 100%; height: 80px; object-fit: contain; }

@media (max-width: 600px) {
	.fm-tester-sample { font-size: 32px; }
	.fm-match-score { flex-basis: 70px; }
}

/* --- glyph info card --- */
.fm-glyph { cursor: pointer; transition: background .1s; }
.fm-glyph:hover { background: #eef4ff; border-radius: 6px; }

.fm-glyph-card-overlay { position: fixed; inset: 0; background: rgba(12,14,18,.6); z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 18px; }
.fm-glyph-card { background: #fff; color: #16181c; border-radius: 18px; box-shadow: 0 26px 80px rgba(0,0,0,.4); width: min(460px, 100%); max-height: 92vh; overflow: auto; position: relative; }

.fm-glyph-card-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #f0f0f2; position: sticky; top: 0; background: #fff; z-index: 2; }
.fm-glyph-card-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; background: #f2f2f5; border-radius: 6px; padding: 3px 8px; }
.fm-glyph-card-name { flex: 1; font-size: 12px; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-glyph-card-close { appearance: none; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; opacity: .45; padding: 0 2px; margin: 0; color: inherit; }
.fm-glyph-card-close:hover { opacity: 1; }

.fm-glyph-card-heroWrap { display: flex; align-items: center; padding: 4px 8px; }
.fm-glyph-card-hero { flex: 1; font-size: 118px; line-height: 1.15; text-align: center; padding: 10px 0 6px; min-height: 130px;
	background: linear-gradient(to bottom, transparent 24%, #f4f4f7 24%, #f4f4f7 calc(24% + 1px), transparent calc(24% + 1px), transparent 78%, #f4f4f7 78%, #f4f4f7 calc(78% + 1px), transparent calc(78% + 1px)); }
.fm-glyph-nav { appearance: none; border: 1px solid #e3e3e6; background: #fff; color: inherit; border-radius: 50%; width: 34px; height: 34px; font-size: 20px; line-height: 1; cursor: pointer; flex: 0 0 auto; margin: 0; padding: 0; }
.fm-glyph-nav:hover { border-color: #16181c; }

.fm-glyph-card-styles { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 4px 16px 0; }
.fm-glyph-mini { font-size: 26px; line-height: 1.3; padding: 2px 7px; border: 1px solid #f0f0f2; border-radius: 8px; }
.fm-glyph-card-stylecap { text-align: center; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .45; margin: 4px 0 2px; }

.fm-glyph-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 18px 4px; }
.fm-glyph-fact { appearance: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid #efeff2; background: #fafafb; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: left; margin: 0; color: inherit; min-width: 0; }
.fm-glyph-fact:hover { border-color: #16181c; }
.fm-glyph-fact.is-copied { border-color: #1e9e4f; background: #f0faf3; }
.fm-glyph-fact span { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; opacity: .5; }
.fm-glyph-fact code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; background: none; padding: 0; }
.fm-glyph-fact.is-copied::after { content: "copied"; font-size: 9px; color: #1e9e4f; text-transform: uppercase; letter-spacing: .08em; }
.fm-glyph-fact[data-copy="UTF-8"], .fm-glyph-card-grid .fm-glyph-fact:last-child { grid-column: 1 / -1; }

.fm-glyph-copy { appearance: none; display: block; width: calc(100% - 36px); margin: 12px 18px 18px; padding: 11px; border: 0; background: #16181c; color: #fff; border-radius: 11px; cursor: pointer; font: inherit; font-weight: 600; }
.fm-glyph-copy:hover { opacity: .88; }
.fm-glyph-copy.is-copied { background: #1e9e4f; }

@media (max-width: 460px) {
	.fm-glyph-card-grid { grid-template-columns: 1fr; }
	.fm-glyph-card-hero { font-size: 92px; }
}
