/* Schema Model reference, PerfectReputations colors. Scoped under .sm-cheat and .sm-modal-overlay. */
.sm-cheat, .sm-modal-overlay {
	--sm-red: #870200;
	--sm-red-dark: #5c0100;
	--sm-ink: #111111;
	--sm-gray: #4a4a4a;
	--sm-line: #dcdcdc;
	--sm-soft: #f3f3f3;
	--sm-yellow: #fcff00;
}
.sm-cheat { max-width: 1240px; margin: 0 auto; color: var(--sm-ink); font-size: 17px; line-height: 1.55; box-sizing: border-box; }
.sm-cheat *, .sm-cheat *::before, .sm-cheat *::after, .sm-modal-overlay *, .sm-modal-overlay *::before, .sm-modal-overlay *::after { box-sizing: border-box; }

/* Header and search */
.sm-cheat .sm-head { margin-bottom: 18px; }
.sm-cheat .sm-head h2 { margin: 0 0 8px; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; color: var(--sm-ink); }
.sm-cheat .sm-lead { color: var(--sm-gray); margin: 0 0 14px; max-width: 820px; }
.sm-cheat .sm-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; position: sticky; top: 0; background: #ffffff; padding: 10px 0; z-index: 2; }
.sm-cheat #sm-search { flex: 1 1 280px; min-height: 48px; padding: 10px 14px; border: 2px solid #b5b5b5; border-radius: 6px; font-size: 17px; color: var(--sm-ink); background: #ffffff; }
.sm-cheat #sm-search:focus { outline: 3px solid var(--sm-yellow); outline-offset: 1px; border-color: var(--sm-ink); }
.sm-cheat .sm-toggle-all { min-height: 48px; padding: 10px 20px; border: 2px solid var(--sm-ink); background: #ffffff; color: var(--sm-ink); border-radius: 6px; font-weight: 700; font-size: 16px; cursor: pointer; white-space: nowrap; }
.sm-cheat .sm-toggle-all:hover { background: var(--sm-ink); color: #ffffff; }

/* Categories */
.sm-cheat .sm-cat { border: 1px solid var(--sm-line); border-top: 6px solid var(--sm-red); border-radius: 14px; margin: 0 0 16px; overflow: hidden; background: #ffffff; }
.sm-cheat .sm-cat-head { margin: 0; }
.sm-cheat .sm-cat-toggle { width: 100%; min-height: 56px; text-align: left; padding: 14px 18px; font-size: 19px; font-weight: 700; background: #ffffff; border: 0; cursor: pointer; color: var(--sm-ink); display: flex; align-items: center; gap: 10px; }
.sm-cheat .sm-cat-toggle:hover { background: var(--sm-soft); }
.sm-cheat .sm-cat-toggle::before { content: "\25B8"; color: var(--sm-red); font-size: 18px; }
.sm-cheat .sm-cat.sm-open .sm-cat-toggle::before { content: "\25BE"; }
.sm-cheat .sm-count { margin-left: auto; font-size: 14px; font-weight: 700; color: #ffffff; background: var(--sm-ink); border-radius: 20px; padding: 2px 11px; }
.sm-cheat .sm-cat-body { display: none; padding: 4px 18px 20px; }
.sm-cheat .sm-cat.sm-open .sm-cat-body { display: block; }
.sm-cheat .sm-intro { color: var(--sm-gray); margin: 0 0 16px; }

/* Term cards */
.sm-cheat .sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sm-cheat .sm-item { border: 1px solid var(--sm-line); border-radius: 10px; padding: 16px; background: var(--sm-soft); }
.sm-cheat .sm-name { font-weight: 800; font-size: 20px; line-height: 1.25; word-break: break-word; }
.sm-cheat .sm-parent { font-size: 13px; color: var(--sm-gray); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin: 4px 0 8px; }
.sm-cheat .sm-item p { margin: 0 0 10px; font-size: 16px; }
.sm-cheat .sm-props { font-size: 15px; color: var(--sm-ink); background: #ffffff; border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.sm-cheat .sm-props-label { font-weight: 700; display: block; color: var(--sm-red); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }

/* Clickable terms */
.sm-cheat a.sm-term { color: var(--sm-red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.sm-cheat a.sm-term:hover { color: var(--sm-red-dark); text-decoration-thickness: 2px; }
.sm-cheat a.sm-term:focus-visible { outline: 3px solid var(--sm-yellow); outline-offset: 2px; box-shadow: 0 0 0 5px var(--sm-ink); border-radius: 2px; }
.sm-cheat .sm-name a.sm-term { text-decoration: none; }
.sm-cheat .sm-name a.sm-term:hover { text-decoration: underline; }

/* Property table */
.sm-cheat .sm-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.sm-cheat .sm-table th, .sm-cheat .sm-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--sm-line); }
.sm-cheat .sm-table th { background: var(--sm-ink); color: #ffffff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.sm-cheat .sm-table tr:nth-child(even) td { background: var(--sm-soft); }
.sm-cheat .sm-prop { font-weight: 800; font-size: 18px; white-space: nowrap; }

.sm-cheat .sm-foot { color: var(--sm-gray); font-size: 14px; margin-top: 16px; text-align: right; }
.sm-cheat .sm-noresults { color: var(--sm-gray); padding: 16px; text-align: center; font-weight: 600; }

/* Modal */
html.sm-modal-open { overflow: hidden; }
.sm-modal-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(17, 17, 17, 0.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sm-modal-overlay[hidden] { display: none; }
.sm-modal { width: 100%; max-width: 900px; height: min(88vh, 960px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #ffffff; border-radius: 14px; border-top: 6px solid var(--sm-red); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); color: var(--sm-ink); font-size: 17px; line-height: 1.6; overflow: hidden; }
.sm-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--sm-line); }
.sm-modal-headtext { flex: 1 1 auto; min-width: 0; }
.sm-modal-kind { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sm-red); }
.sm-modal-title { margin: 2px 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; color: var(--sm-ink); word-break: break-word; }
.sm-modal-back, .sm-modal-close { flex: 0 0 auto; min-width: 44px; min-height: 44px; border: 2px solid var(--sm-ink); background: #ffffff; color: var(--sm-ink); border-radius: 6px; font-weight: 700; cursor: pointer; }
.sm-modal-back { padding: 0 14px; font-size: 15px; }
.sm-modal-back[hidden] { display: none; }
.sm-modal-close { font-size: 26px; line-height: 1; }
.sm-modal-back:hover, .sm-modal-close:hover { background: var(--sm-ink); color: #ffffff; }
.sm-modal-back:focus-visible, .sm-modal-close:focus-visible, .sm-chip:focus-visible, .sm-modal-ext:focus-visible { outline: 3px solid var(--sm-yellow); outline-offset: 2px; box-shadow: 0 0 0 5px var(--sm-ink); }
.sm-modal-body { flex: 1 1 auto; min-height: 0; padding: 20px 24px; overflow-y: scroll; scrollbar-width: auto; scrollbar-color: var(--sm-red) var(--sm-soft); }
.sm-modal-body::-webkit-scrollbar { width: 14px; }
.sm-modal-body::-webkit-scrollbar-track { background: var(--sm-soft); border-left: 1px solid var(--sm-line); }
.sm-modal-body::-webkit-scrollbar-thumb { background: var(--sm-red); border-radius: 8px; border: 3px solid var(--sm-soft); }
.sm-modal-body::-webkit-scrollbar-thumb:hover { background: var(--sm-red-dark); }
.sm-modal-h { margin: 22px 0 8px; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sm-red); border-bottom: 2px solid var(--sm-line); padding-bottom: 6px; }
.sm-modal-body > .sm-modal-h:first-child { margin-top: 0; }
.sm-modal-plain { margin: 0 0 6px; font-size: 19px; line-height: 1.6; }
.sm-modal-examples { margin: 0 0 6px; padding-left: 24px; }
.sm-modal-examples li { margin-bottom: 6px; font-size: 17px; }
.sm-modal-format { background: var(--sm-soft); border-radius: 10px; padding: 14px 16px; margin-bottom: 6px; }
.sm-format-rule { margin: 0 0 10px; font-weight: 600; }
.sm-format-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-top: 6px; }
.sm-format-tag { flex: 0 0 auto; min-width: 70px; text-align: center; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 4px; }
.sm-format-good .sm-format-tag { background: #1d6b2a; color: #ffffff; }
.sm-format-bad .sm-format-tag { background: var(--sm-red); color: #ffffff; }
.sm-format-row code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; background: #ffffff; border: 1px solid var(--sm-line); border-radius: 4px; padding: 2px 8px; overflow-wrap: anywhere; color: var(--sm-ink); }
.sm-format-bad code { text-decoration: line-through; text-decoration-color: var(--sm-red); }
.sm-modal-admin { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--sm-red); }
.sm-modal-def { margin: 0 0 18px; font-size: 17px; color: #333333; }
.sm-modal-note { margin: 0 0 14px; color: var(--sm-gray); font-size: 15px; }
.sm-modal-warn { margin: 0 0 12px; padding: 10px 12px; background: #fff8d6; border-left: 5px solid var(--sm-ink); border-radius: 6px; font-weight: 600; }
.sm-modal-group { margin: 0 0 16px; }
.sm-modal-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sm-gray); margin-bottom: 8px; }
.sm-modal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-chip { min-height: 40px; padding: 6px 14px; border: 2px solid var(--sm-red); background: #ffffff; color: var(--sm-red); border-radius: 999px; font-size: 15px; font-weight: 700; cursor: pointer; }
.sm-chip:hover { background: var(--sm-red); color: #ffffff; }
.sm-modal-foot { padding: 14px 20px; border-top: 1px solid var(--sm-line); background: var(--sm-soft); }
.sm-modal-ext { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; background: var(--sm-red); color: #ffffff !important; border-radius: 6px; font-weight: 700; text-decoration: none !important; }
.sm-modal-ext:hover { background: var(--sm-red-dark); }

/* Tablet and phone */
@media (max-width: 900px) {
	.sm-cheat .sm-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
	.sm-cheat { font-size: 16px; }
	.sm-cheat .sm-grid { grid-template-columns: 1fr; }
	.sm-cheat .sm-cat-body { padding: 4px 12px 16px; }
	.sm-cheat .sm-cat-toggle { font-size: 17px; padding: 12px 14px; }
	.sm-cheat .sm-toggle-all { width: 100%; }
	.sm-cheat .sm-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.sm-cheat .sm-prop { white-space: normal; }
	.sm-modal-overlay { padding: 0; align-items: stretch; }
	.sm-modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
	.sm-modal-head, .sm-modal-body, .sm-modal-foot { padding-left: 16px; padding-right: 16px; }
}
