/* Klar & Glo GloCoin – reuses the theme's design tokens (--sc-*) with safe fallbacks. */
.kgc-wallet, .kgc-box, .kgc-mini, .kgc-thanks, .kgc-toast {
	--kgc-ink: var(--sc-black, #111);
	--kgc-paper: var(--sc-white, #fff);
	--kgc-cream: var(--sc-cream, #f6f4ef);
	--kgc-line: var(--sc-line, #e4e2dd);
	--kgc-muted: var(--sc-grey-600, #6f6f6f);
	--kgc-accent: var(--sc-accent, #5c7a5e);
	--kgc-radius: var(--sc-radius, 2px);
}

/* ---- wallet page ---- */
.kgc-wallet { max-width: 860px; }
.kgc-card { background: var(--kgc-ink); color: var(--kgc-paper); padding: 28px 28px 24px; border-radius: var(--kgc-radius); display: flex; flex-direction: column; gap: 4px; }
.kgc-card__label { font-size: 14px; opacity: .75; }
.kgc-card__num { font-size: 56px; line-height: 1.05; font-weight: 500; letter-spacing: -1px; }
.kgc-card__sub { font-size: 14px; color: #c9d8ca; }
.kgc-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 14px 0 0; border: 1px solid var(--kgc-line); border-radius: var(--kgc-radius); }
.kgc-stats > div { flex: 1 1 140px; padding: 14px 18px; border-right: 1px solid var(--kgc-line); }
.kgc-stats > div:last-child { border-right: 0; }
.kgc-stats dt { font-size: 13px; color: var(--kgc-muted); margin: 0 0 2px; }
.kgc-stats dd { margin: 0; font-size: 22px; font-weight: 500; }
.kgc-intro { margin: 20px 0 0; color: var(--kgc-muted); max-width: 64ch; line-height: 1.6; }
.kgc-how { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 8px; }
.kgc-how > div { background: var(--kgc-cream); padding: 16px 18px; border-radius: var(--kgc-radius); }
.kgc-how h3 { margin: 0 0 6px; font-size: 16px; }
.kgc-how p { margin: 0; font-size: 14px; line-height: 1.55; }
.kgc-h { margin: 26px 0 10px; font-size: 18px; }
.kgc-empty { padding: 18px; background: var(--kgc-cream); border-radius: var(--kgc-radius); margin: 0; }
.kgc-table-wrap { overflow-x: auto; }
.kgc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kgc-table th { text-align: left; font-weight: 500; color: var(--kgc-muted); padding: 8px 10px; border-bottom: 1px solid var(--kgc-ink); white-space: nowrap; }
.kgc-table td { padding: 12px 10px; border-bottom: 1px solid var(--kgc-line); vertical-align: top; }
.kgc-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kgc-plus { color: var(--kgc-accent); font-weight: 600; }
.kgc-minus { color: #9b2c2c; font-weight: 600; }
.kgc-muted { color: var(--kgc-muted); font-size: 13px; }
.kgc-pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 14px; font-size: 14px; }

/* dashboard strip */
.kgc-mini { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--kgc-cream); padding: 14px 18px; margin: 0 0 20px; border-radius: var(--kgc-radius); }
.kgc-mini__label { display: block; font-size: 13px; color: var(--kgc-muted); }
.kgc-mini__num { font-size: 26px; font-weight: 500; }
.kgc-mini__link { color: var(--kgc-ink); text-decoration: underline; font-size: 14px; }

/* order confirmation */
.kgc-thanks { background: var(--kgc-cream); padding: 14px 18px; margin: 18px 0; border-radius: var(--kgc-radius); }
.kgc-thanks p { margin: 6px 0 0; }

/* ---- checkout box (classic + block) ---- */
.kgc-wrap { padding-top: 16px; padding-bottom: 16px; }
.kgc-box { border: 1px solid var(--kgc-line); background: var(--kgc-cream); padding: 14px 16px; margin: 0 0 16px; border-radius: var(--kgc-radius); font-size: 14px; box-sizing: border-box; width: 100%; }
.kgc-wrap .kgc-box { margin: 0; }
.kgc-box[hidden] { display: none; }
.kgc-box__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.kgc-box__head strong { font-size: 15px; }
.kgc-box__head span { color: var(--kgc-muted); font-size: 13px; }
.kgc-box__use { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; cursor: pointer; }
.kgc-box__use input { margin: 0; accent-color: var(--kgc-ink); }
.kgc-box__row { display: flex; gap: 8px; align-items: stretch; }
.kgc-box__row input[type=number] { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid #cfcfcf; background: #fff; border-radius: var(--kgc-radius); font-size: 15px; box-sizing: border-box; -moz-appearance: textfield; appearance: textfield; }
.kgc-box__row input[type=number]::-webkit-outer-spin-button, .kgc-box__row input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kgc-btn, .kgc-box .button.kgc-btn { height: 40px; background: var(--kgc-ink); color: #fff; border: 0; padding: 0 20px; cursor: pointer; border-radius: var(--kgc-radius); font-size: 14px; line-height: 1; }
.kgc-btn:disabled { opacity: .55; cursor: default; }
.kgc-box__applied { margin: 10px 0 0; color: var(--kgc-accent); font-weight: 600; }
.kgc-box__note { margin: 8px 0 0; color: var(--kgc-muted); line-height: 1.5; font-size: 13px; }
.kgc-box__msg { margin: 6px 0 0; min-height: 0; color: #9b2c2c; }
.kgc-box__msg:empty { display: none; }

/* welcome toast */
.kgc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100001; background: var(--kgc-ink); color: #fff; padding: 14px 22px; max-width: calc(100vw - 32px); border-radius: var(--kgc-radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 15px; animation: kgc-toast 6s ease forwards; }
@keyframes kgc-toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .kgc-toast { animation: none; } }

/* ---- small screens: history rows become stacked cards ---- */
@media (max-width: 640px) {
	.kgc-card__num { font-size: 44px; }
	.kgc-how { grid-template-columns: 1fr; }
	.kgc-stats > div { flex-basis: 50%; border-bottom: 1px solid var(--kgc-line); }
	.kgc-table thead { display: none; }
	.kgc-table, .kgc-table tbody, .kgc-table tr, .kgc-table td { display: block; width: 100%; }
	.kgc-table tr { border-bottom: 1px solid var(--kgc-line); padding: 10px 0; }
	.kgc-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
	.kgc-table td::before { content: attr(data-label); color: var(--kgc-muted); text-align: left; }
	.kgc-num { text-align: right !important; }
}
