/* Rupa Kisan — clean market look.
 * Light neutral page, white cards with soft shadows, one green "buy" colour, mustard as the
 * brand accent only. The crop illustrations and the palika stamp carry the local character. */

/* Anek Devanagari's middle dot has no right side-bearing ("परियार ·देउराली"), so the
   separator comes from the system font instead; everything else stays Anek. */
@font-face {
	font-family: "RK Punct";
	src: local("Roboto"), local("Helvetica Neue"), local("Helvetica"), local("Arial");
	unicode-range: U+00B7, U+2022;
}

:root {
	/* System-bar insets. Browsers fill these from env(); the Android shell overwrites them
	 * with real values (Android WebView reports 0 for env() under edge-to-edge). */
	--sat: env(safe-area-inset-top, 0px);
	--sab: env(safe-area-inset-bottom, 0px);
	--ink: #1c211e;           /* text */
	--ink-2: #5c655f;         /* secondary text (7.1:1 on white) */
	--on-accent: #1c211e;     /* text on mustard */
	--paper: #ffffff;         /* cards */
	--bg: #f4f5f1;            /* page */
	--wash: #fdf6d8;          /* pale mustard highlight */
	--mustard: #f3c623;
	--mustard-deep: #c99a00;
	--chili: #c23a1f;         /* 5.3:1 on white — text-safe */
	--chili-bright: #e0482b;  /* decoration only */
	--leaf: #1f7a35;          /* primary / buy (5.6:1 with white text) */
	--leaf-ink: #1f7a35;
	--leaf-wash: #e5f3e5;
	--sky: #1f5fa8;
	--line: #e2e1da;          /* hairlines */
	--line-strong: #c9c7bd;
	--shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 8px 24px rgba(16, 24, 20, .07);
	--shadow-sm: 0 1px 3px rgba(16, 24, 20, .10);
	--radius: 16px;
	--display: "RK Punct", "Anek Devanagari", "Noto Sans Devanagari", system-ui, sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ink: #eef0ec;
		--ink-2: #a9b2ab;
		--paper: #1b201d;
		--bg: #111512;
		--wash: #2c2811;
		--leaf-wash: #173020;
		--line: #2f3631;
		--line-strong: #46504a;
		--mustard: #e8bb1a;
		--leaf: #2f9a48;
		--leaf-ink: #7bd48c;
		--chili: #ff7a5c;
		--sky: #7fb2ff;
		--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
		--shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
		color-scheme: dark;
	}
	:root:not([data-theme="light"]) .rk-tabs { border: 1px solid var(--line); }
	:root:not([data-theme="light"]) .rk-icon-btn,
	:root:not([data-theme="light"]) .rk-add,
	:root:not([data-theme="light"]) .rk-tag:not(.organic) { background: var(--paper); color: var(--ink); border-color: var(--line); }
	:root:not([data-theme="light"]) .rk-btn:not(.ghost):not(.danger) { border-color: var(--line); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 500 16px/1.45 var(--display);
	font-variant-numeric: tabular-nums;
	padding-bottom: calc(84px + var(--sab));
	-webkit-tap-highlight-color: transparent;
}
a { color: var(--sky); }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }

/* ---------- app bar ---------- */
.rk-top {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between;
	padding: calc(10px + var(--sat)) 16px 10px;
	background: var(--mustard);
	border-bottom: 1px solid var(--line);
	color: var(--on-accent);
}
.rk-brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.rk-brand b { font-size: 24px; font-weight: 800; font-stretch: 75%; letter-spacing: -0.01em; line-height: 1; }
.rk-brand small { font-size: 12px; font-weight: 700; padding: 2px 6px; border: 1.5px solid currentColor; border-radius: 4px; transform: translateY(-3px); }
.rk-top nav { display: flex; gap: 8px; }
.rk-icon-btn {
	position: relative; display: grid; place-items: center;
	width: 44px; height: 44px; border-radius: 12px;
	background: #fff; color: var(--on-accent); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
	text-decoration: none;
}
.rk-icon-btn svg { width: 20px; height: 20px; }
.rk-badge {
	position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px;
	border-radius: 10px; background: var(--chili); color: #fff; border: 1px solid var(--line);
	font-size: 12px; font-weight: 800; line-height: 16px; text-align: center;
}
.rk-badge:empty, .rk-badge[data-n="0"] { display: none; }
.rk-top::after {
	/* dhaka-weave band: tiny triangles in chili / ink / mustard */
	content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 6px;
	background:
		conic-gradient(from 135deg at 50% 0, var(--chili-bright) 90deg, transparent 0) 0 0 / 12px 6px,
		linear-gradient(90deg, var(--on-accent) 50%, #1f5fa8 0) 0 0 / 24px 6px;
	border-bottom: 1px solid var(--line);
}
.rk-embedded .rk-top { display: none; }

main { max-width: 560px; margin: 0 auto; padding: 24px 16px 24px; }
h1, h2, h3 { font-weight: 800; font-stretch: 80%; line-height: 1.1; margin: 18px 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 26px; } h3 { font-size: 20px; }
.rk-muted { color: var(--ink-2); }
/* No letter-spacing: tracking breaks Devanagari conjunct shaping. */
.rk-eyebrow { display: inline-block; font-size: 14px; font-weight: 700; color: var(--ink-2); border-bottom: 3px solid var(--mustard); padding-bottom: 1px; margin: 0; }

/* ---------- crop chips ---------- */
.rk-chips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
.rk-chips::-webkit-scrollbar { display: none; }
.rk-chip {
	flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px;
	width: 72px; padding: 8px 4px 6px; text-decoration: none; color: var(--ink);
	border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
	font-size: 13px; font-weight: 600; line-height: 1.1; text-align: center;
}
.rk-chip img { width: 40px; height: 40px; object-fit: contain; }
.rk-chip .rk-all { width: 40px; height: 40px; display: grid; place-items: center; font-size: 18px; font-weight: 800; }
.rk-chip.on { background: var(--mustard); box-shadow: var(--shadow-sm); color: var(--on-accent); border-color: transparent; }

/* ---------- feed post ---------- */
.rk-feed { display: grid; gap: 32px; margin-top: 8px; }
.rk-post { position: relative; }
.rk-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rk-avatar {
	flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; font-weight: 800; font-size: 17px;
	background: var(--leaf-wash); border: 1px solid var(--line); color: var(--ink);
}
.rk-who { flex: 1; min-width: 0; line-height: 1.2; }
.rk-who b { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-who small { color: var(--ink-2); font-size: 13px; }
.rk-stamp {
	flex: 0 0 auto; transform: rotate(-5deg);
	padding: 4px 9px 2px; border: 2px solid var(--leaf-ink); border-radius: 4px; color: var(--leaf-ink);
	box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--leaf-ink);
	font-size: 13px; font-weight: 800; letter-spacing: .02em; line-height: 1.15; text-align: center;
	/* uneven ink: fractal-noise mask so the stamp looks hand-pressed */
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 2.1'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 2.1'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
.rk-stamp small { display: block; font-size: 11px; font-weight: 700; }

.rk-photo-wrap { position: relative; }
.rk-photo {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: 4 / 5; border-radius: var(--radius);
	border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--wash);
}
.rk-photo > img, .rk-photo > video { width: 100%; height: 100%; object-fit: cover; }
.rk-price {
	position: absolute; left: 12px; bottom: 12px;
	padding: 6px 12px 4px; border-radius: 10px; transform: rotate(-2deg);
	background: radial-gradient(circle at 10px 50%, transparent 3px, var(--on-accent) 3.5px, var(--on-accent) 4.5px, var(--mustard) 5px);
	color: var(--on-accent); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
	padding-left: 22px; font-weight: 800; font-stretch: 80%; font-size: 21px; line-height: 1;
}
.rk-price small { font-size: 13px; font-weight: 700; }
.rk-tag {
	position: absolute; left: 12px; top: 12px; padding: 4px 9px 2px; border-radius: 8px;
	background: #fff; color: var(--on-accent); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.rk-tag.organic { background: var(--leaf-ink); color: #fff; }
.rk-add {
	position: absolute; right: 14px; bottom: 14px; width: 52px; height: 52px; border-radius: 50%;
	display: grid; place-items: center; cursor: pointer;
	background: #fff; color: var(--on-accent); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
	font-size: 30px; font-weight: 600; line-height: 1;
}
.rk-add:active, .rk-btn:active, .rk-icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.rk-add.added { background: var(--leaf-ink); color: #fff; }
.rk-post-body { padding: 12px 2px 0; }
.rk-post-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rk-post-title b { font-size: 21px; font-weight: 800; font-stretch: 85%; }
.rk-caption { margin: 4px 0 8px; color: var(--ink); }
.rk-stock { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.rk-meter { flex: 1; height: 8px; border: 1.5px solid var(--line); border-radius: 6px; overflow: hidden; }
.rk-meter i { display: block; height: 100%; background: var(--leaf); }
.rk-preorder { color: var(--chili); font-weight: 700; }
.rk-offline {
	position: sticky; top: calc(70px + var(--sat)); z-index: 15; margin: -8px 0 12px; padding: 8px 12px; border-radius: 10px;
	background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px;
}
.rk-chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.rk-chips-row label, .rk-crop-pick label { margin: 0; position: relative; } /* anchor the 1px radios */
.rk-chips-row span {
	display: inline-block; padding: 9px 14px 7px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px;
	font-weight: 600; cursor: pointer;
}
.rk-chips-row input:checked + span { background: var(--mustard); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.rk-chips-row label:has(input:focus-visible) span { outline: 3px solid var(--sky); outline-offset: 2px; }
.rk-mic { display: flex; align-items: center; gap: 10px; }
.rk-mic svg { width: 24px; height: 24px; }
.rk-mic.rec { background: var(--chili); color: #fff; border-color: var(--chili); }

/* ---------- cards, forms, buttons ---------- */
.rk-card {
	background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow); padding: 16px; margin: 16px 0;
}
.rk-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; }
.rk-line { border-top: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent); margin: 12px 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
	width: 100%; padding: 13px 14px; border-radius: 12px; font-size: 17px;
	border: 1px solid var(--line); background: var(--paper);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
.rk-crop-pick label:has(input:focus-visible), .rk-capture:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--sky); }
.rk-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
legend { font-weight: 600; margin: 0 0 6px; padding: 0; }
html, body { overflow-x: clip; }
textarea { min-height: 88px; resize: vertical; }
.rk-btn {
	display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
	min-height: 54px; padding: 12px 18px; margin: 12px 0 0; cursor: pointer;
	border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow);
	background: var(--mustard); color: var(--on-accent); font-size: 19px; font-weight: 800; font-stretch: 90%;
	text-decoration: none;
}
.rk-btn.leaf { background: var(--leaf-ink); color: #fff; }
.rk-btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.rk-btn.danger { background: var(--paper); color: var(--chili); border-color: var(--chili); box-shadow: var(--shadow-sm); }
.rk-btn:disabled { opacity: .45; box-shadow: none; }
.rk-btns { display: flex; gap: 10px; } .rk-btns .rk-btn { flex: 1; }
.rk-link { background: none; border: 0; color: var(--sky); font-weight: 600; padding: 4px 6px; min-height: 44px; cursor: pointer; text-decoration: underline; }
.rk-status {
	display: inline-block; padding: 3px 10px 1px; border-radius: 999px; font-size: 13px; font-weight: 700;
	border: 1.5px solid var(--line); background: var(--wash);
}
.rk-status[data-s="Delivered"], .rk-status[data-s="Verified"], .rk-status[data-s="Accepted"] { background: var(--leaf-wash); }
.rk-status[data-s="Cancelled"], .rk-status[data-s="Rejected"], .rk-status[data-s="No Show"], .rk-status[data-s="Delivery Failed"] { color: var(--chili); border-color: var(--chili); background: transparent; }

/* order timeline */
.rk-steps { display: flex; gap: 4px; margin: 10px 0 4px; }
.rk-steps i { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.rk-steps i.on { background: var(--leaf); }

/* ---------- post composer ---------- */
.rk-capture {
	position: relative; display: grid; place-items: center; text-align: center; cursor: pointer;
	min-height: 260px; margin: 0; padding: 20px; border-radius: 18px;
	border: 1px dashed var(--line); background: var(--wash); overflow: hidden;
}
.rk-capture b { display: block; font-size: 22px; font-weight: 800; font-stretch: 85%; }
.rk-capture svg { width: 56px; height: 56px; margin: 0 auto 8px; }
.rk-capture.has-media { padding: 0; border-style: solid; }
#rk-preview { display: flex; justify-content: center; gap: 6px; width: 100%; }
#rk-preview > div { display: grid; justify-items: center; gap: 2px; }
.rk-capture.has-media #rk-preview { justify-content: flex-start; overflow-x: auto; }
#rk-preview img, #rk-preview video { height: 260px; width: auto; object-fit: cover; border-radius: 12px; }
.rk-crop-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 4px; }
.rk-crop-pick label {
	margin: 0; padding: 8px 2px 6px; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.15;
	border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--paper);
}
.rk-crop-pick label[hidden] { display: none; }
#rk-cats, #rk-subcats { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 8px; padding: 2px 16px 6px; scrollbar-width: none; }
#rk-cats span, #rk-subcats span { white-space: nowrap; }
/* Sub-categories of the palika's tree: a lighter second row under the category chips */
#rk-subcats[hidden] { display: none; }
#rk-subcats { margin-top: -6px; }
#rk-subcats span { font-size: 15px; background: var(--paper); }
#rk-subcats input:checked + span { background: var(--leaf-wash); color: var(--ink); border-color: var(--leaf); box-shadow: none; }
.rk-crop-pick label:has(input:checked) { background: var(--mustard); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.rk-crop-pick input, .rk-chips-row input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.rk-crop-pick img { width: 46px; height: 46px; object-fit: contain; margin: 0 auto 2px; }
.rk-stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.rk-stepper button {
	height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper);
	font-size: 28px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm);
}
.rk-stepper input { text-align: center; font-size: 26px; font-weight: 800; height: 56px; padding: 0 8px; }
.rk-hint { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
details { margin: 14px 0; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.rk-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.rk-check input { width: 22px; height: 22px; accent-color: var(--leaf); }

/* farmer dashboard */
.rk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rk-mini { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.rk-mini img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 1px solid var(--line); }
.rk-mini div { padding: 6px 8px; } .rk-mini b { display: block; }
.rk-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.rk-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--wash); }
.rk-kpi b { display: block; font-size: 24px; font-weight: 800; font-stretch: 80%; }
.rk-kpi small { color: var(--ink-2); font-size: 12px; }

/* empty state */
.rk-empty { text-align: center; padding: 28px 8px; color: var(--ink-2); }
.rk-empty img { width: 96px; margin: 0 auto 10px; }

/* ---------- tab bar ---------- */
.rk-tabs {
	position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(10px + var(--sab));
	max-width: 536px; margin: 0 auto; display: flex; align-items: center; padding: 6px;
	background: var(--on-accent); border-radius: 20px; box-shadow: var(--shadow);
}
.rk-tabs a {
	flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px;
	color: #f6ead2; text-decoration: none; font-size: 12px; font-weight: 600; border-radius: 14px;
}
.rk-tabs a svg { width: 22px; height: 22px; }
.rk-tabs a.on { color: var(--mustard); }
.rk-tabs .rk-post-btn { flex: 0 0 auto; margin: -22px 6px 0; width: 64px; height: 64px; border-radius: 50%; justify-content: center;
	background: var(--mustard); color: var(--on-accent); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rk-tabs .rk-post-btn svg { width: 30px; height: 30px; }
.rk-tabs .rk-post-btn.on { color: var(--on-accent); background: #fff4c7; }
.rk-tabs .rk-post-btn span { display: none; }

/* ---------- toast & scanner ---------- */
#rk-toast[data-idle] { clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; }
#rk-toast {
	position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(96px + var(--sab));
	max-width: 520px; margin: 0 auto; padding: 12px 16px; border-radius: 14px;
	background: var(--ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow);
}
#rk-toast.bad { background: var(--chili); color: #fff; }
.rk-scan { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; place-items: center; }
.rk-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rk-scan-frame { position: relative; width: 64vw; aspect-ratio: 1; border: 4px solid var(--mustard); border-radius: 24px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.rk-scan button { position: absolute; bottom: calc(32px + var(--sab)); left: 50%; transform: translateX(-50%); width: auto;
	padding: 12px 28px; border-radius: 14px; border: 1px solid var(--line); background: var(--mustard); color: var(--on-accent); font-weight: 800; }

.rk-skel { height: 420px; border-radius: var(--radius); border: 2px solid color-mix(in srgb, var(--ink) 20%, transparent);
	background: linear-gradient(100deg, var(--wash) 40%, var(--paper) 50%, var(--wash) 60%) 0 0/200% 100%; animation: rk-sh 1.2s linear infinite; }
@keyframes rk-sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rk-skel { animation: none; } .rk-add:active, .rk-btn:active { transform: none; } }

/* ======================================================================
 * Farmer screens (farmer.js) — huge targets, one obvious action, tracking steps.
 * ====================================================================== */
.kf-subnav {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: -8px 0 16px;
}
.kf-subnav a {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
	min-height: 60px; padding: 8px 2px 6px; border-radius: 14px; border: 1px solid var(--line);
	color: var(--ink); text-decoration: none; font-weight: 700; font-size: 13px; background: var(--paper);
}
.kf-subnav a svg { width: 24px; height: 24px; }
.kf-subnav a.on { background: var(--ink); color: var(--paper); }
.kf-dot { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
	background: var(--chili); color: #fff; font-style: normal; font-size: 12px; line-height: 20px; border: 2px solid var(--paper); }

.kf-hello { font-size: 20px; margin: 0 0 10px; }
.kf-stars { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 8px; background: var(--wash); font-weight: 800; }

/* The one card that says what to do next */
.kf-next {
	position: relative; padding: 18px 18px 16px; border-radius: 20px; border: 1px solid var(--line);
	box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.kf-next.tone-action { background: var(--mustard); color: var(--on-accent); }
.kf-next.tone-good { background: var(--leaf-wash); }
.kf-next.tone-info { background: var(--wash); }
.kf-next h2 { font-size: 30px; margin: 4px 0 6px; }
.kf-next p { margin: 0 0 6px; font-size: 18px; }
.kf-next-kicker { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px !important; }
.kf-next-kicker svg { width: 20px; height: 20px; }
.kf-next .rk-btn { border-color: transparent; }
.tone-action .rk-btn:not(.leaf) { background: #fff; color: var(--on-accent); }

.kf-deadline { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--chili); }
.kf-next .kf-deadline { color: #7a1d0c; }
.kf-deadline svg { width: 20px; height: 20px; }

.kf-speak {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 44px; padding: 6px 14px;
	border-radius: 999px; border: 2px solid currentColor; background: transparent; color: inherit; font-weight: 700; cursor: pointer;
}
.kf-speak svg { width: 22px; height: 22px; }

/* Money strip */
.kf-money {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 20px; text-decoration: none; color: var(--ink);
	border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.kf-money span { padding: 10px 10px 8px; border-right: 2px solid var(--line); }
.kf-money span:last-child { border-right: 0; }
.kf-money span:nth-child(2) { background: var(--wash); }
.kf-money small { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kf-money b { font-size: 19px; font-weight: 800; font-stretch: 80%; }
.kf-money.big b { font-size: 24px; }

/* Order card */
.kf-order {
	border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 0 0 16px; background: var(--paper); box-shadow: var(--shadow-sm);
}
.kf-order.is-new { border-width: 3px; border-color: transparent; box-shadow: var(--shadow-sm); }
.kf-order.is-dead { opacity: .75; box-shadow: none; }
.kf-order-head { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.kf-icons { display: flex; flex: 0 0 auto; }
.kf-icons img { width: 52px; height: 52px; object-fit: contain; margin-right: -14px; }
.kf-icons img:last-child { margin-right: 0; }
.kf-what { flex: 1; min-width: 0; line-height: 1.25; }
.kf-what b { display: block; font-size: 19px; font-weight: 800; }
.kf-what small { color: var(--ink-2); font-size: 13px; }
.kf-amt { font-size: 22px; font-weight: 800; font-stretch: 80%; white-space: nowrap; }
.kf-dead { color: var(--chili); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.kf-dead svg { width: 20px; height: 20px; }

/* Horizontal parcel tracker: done = leaf, now = mustard glow, later = hollow */
.kf-track { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin: 14px 0 6px; padding: 0; position: relative; }
.kf-track::before { content: ""; position: absolute; left: 8%; right: 8%; top: 18px; height: 3px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.kf-track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 11px; line-height: 1.15; color: var(--ink-2); }
.kf-track i {
	width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
	background: var(--paper); border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent); color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.kf-track i svg { width: 20px; height: 20px; }
.kf-track li.done i { background: var(--leaf-ink); border-color: var(--leaf-ink); color: #fff; }
.kf-track li.done { color: var(--ink); }
.kf-track li.now i { background: var(--mustard); border: 1px solid var(--line); color: var(--on-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mustard) 40%, transparent); }
.kf-track li.now { color: var(--ink); font-weight: 800; }

/* Accept / can't */
.kf-yesno { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 10px; }
.kf-yesno button {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px;
	border-radius: 18px; border: 1px solid var(--line); font-size: 22px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-sm);
}
.kf-yesno svg { width: 32px; height: 32px; }
.kf-yes { background: var(--leaf-ink); color: #fff; }
.kf-no { background: var(--paper); color: var(--chili); border-color: var(--chili) !important; box-shadow: var(--shadow-sm); }
.kf-yesno button:active { transform: translate(3px, 3px); box-shadow: none; }
.kf-drop { background: var(--wash); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.kf-drop p { margin: 4px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 17px; }
.kf-drop svg { width: 22px; height: 22px; }
.kf-code b { font-size: 26px; letter-spacing: .08em; font-family: ui-monospace, monospace; background: #fff; padding: 2px 8px; border-radius: 6px; border: 2px dashed var(--on-accent); color: var(--on-accent); }
.rk-btn svg { width: 24px; height: 24px; }

/* Vertical journey / timeline */
.kf-journey { list-style: none; margin: 0 0 16px; padding: 0; position: relative; }
.kf-journey::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 3px; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.kf-journey li { position: relative; display: flex; gap: 14px; padding: 8px 0; }
.kf-journey li > i {
	position: relative; z-index: 1; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
	background: var(--paper); border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent); color: var(--ink-2);
}
.kf-journey li > i svg { width: 22px; height: 22px; }
.kf-journey li > i img { width: 34px; height: 34px; object-fit: contain; }
.kf-journey li.done > i { border-color: var(--leaf-ink); color: var(--leaf-ink); }
.kf-journey li.tone-good > i { background: var(--leaf-wash); }
.kf-journey li.tone-action > i { background: var(--mustard); border-color: transparent; color: var(--on-accent); }
.kf-journey li.tone-bad > i { border-color: var(--chili); color: var(--chili); }
.kf-journey li.now > i { background: var(--mustard); border: 1px solid var(--line); color: var(--on-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mustard) 40%, transparent); }
.kf-journey li:not(.done):not(.now) { color: var(--ink-2); }
.kf-journey li > div, .kf-journey li > a { flex: 1; min-width: 0; padding-top: 2px; color: inherit; text-decoration: none; }
.kf-journey b { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
.kf-journey p { margin: 2px 0; }
.kf-journey small { color: var(--ink-2); font-size: 13px; }
.kf-journey li.unseen b::after { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--chili); margin-left: 6px; vertical-align: middle; }
.kf-day { font-weight: 800; margin: 16px 0 4px; color: var(--ink-2); }
.kf-promise { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--leaf-wash); font-weight: 700; }
.kf-promise svg { width: 22px; height: 22px; flex: 0 0 auto; }

/* Posts */
.kf-post { border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin: 0 0 14px; box-shadow: var(--shadow-sm); }
.kf-post-top { display: flex; gap: 12px; }
.kf-thumb { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }
.kf-thumb.icon { object-fit: contain; background: var(--wash); }
.kf-post-top b { font-size: 20px; font-weight: 800; margin-right: 6px; }
.kf-post-top p { margin: 4px 0; }
.kf-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-top: 12px; }
.kf-actions button {
	display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 6px 2px;
	border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer;
}
.kf-actions svg { width: 24px; height: 24px; }
.kf-actions button:active { background: var(--mustard); color: var(--on-accent); }

/* Ledger */
.kf-ledger { list-style: none; margin: 12px 0; padding: 0; }
.kf-ledger li { border-bottom: 2px dashed color-mix(in srgb, var(--ink) 20%, transparent); }
.kf-ledger a { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.kf-ledger img { width: 44px; height: 44px; object-fit: contain; }
.kf-ledger span:nth-child(2) { flex: 1; min-width: 0; } .kf-ledger b { display: block; }
.kf-ledger small { color: var(--ink-2); font-size: 13px; }
.kf-ledger-amt { text-align: right; }
.kf-ledger-amt small { font-weight: 800; }
small.tone-good { color: var(--leaf-ink); } small.tone-action { color: var(--chili); }

.kf-big-post { margin-top: 20px; min-height: 64px; font-size: 21px; }
.kf-call {
	display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 0; min-height: 56px;
	border-radius: 14px; border: 1px dashed var(--line); color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px;
}
.kf-call svg { width: 24px; height: 24px; }

/* Bottom sheet + number pad */
.kf-sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(20, 12, 6, .55); display: flex; align-items: flex-end; justify-content: center; }
.kf-sheet {
	width: 100%; max-width: 560px; background: var(--paper); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0;
	padding: 18px 16px calc(16px + var(--sab)); max-height: 90vh; overflow: auto;
}
.kf-sheet h3 { margin-top: 0; font-size: 22px; }
.kf-display { text-align: center; padding: 10px; border-radius: 14px; background: var(--wash); margin-bottom: 12px; }
.kf-display b { font-size: 44px; font-weight: 800; }
.kf-display b.hint { opacity: .35; }
.kf-display span { font-size: 20px; font-weight: 700; }
.kf-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kf-keys button {
	min-height: 64px; font-size: 30px; font-weight: 800; border-radius: 14px; border: 1px solid var(--line);
	background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer;
}
.kf-keys button:active { background: var(--mustard); color: var(--on-accent); transform: translate(2px, 2px); box-shadow: none; }
.kf-choices { display: grid; gap: 10px; }
.kf-choices .rk-btn { margin: 0; justify-content: flex-start; font-size: 20px; }

/* Guided help */
.kf-guide { text-align: center; }
.kf-guide-art { position: relative; display: grid; place-items: center; width: 140px; height: 140px; margin: 4px auto 8px; border-radius: 50%; background: var(--mustard); border: 1px solid var(--line); color: var(--on-accent); }
.kf-guide-art svg { width: 72px; height: 72px; }
.kf-guide-art img { position: absolute; right: -14px; bottom: -8px; width: 64px; height: 64px; }
.kf-guide h3 { font-size: 26px; margin: 6px 0; }
.kf-guide p { font-size: 19px; line-height: 1.5; margin: 0 0 6px; }
.kf-guide-dots { display: flex; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.kf-guide-dots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 20%, transparent); }
.kf-guide-dots i.on { background: var(--ink); width: 26px; border-radius: 5px; }
button.kf-call { width: 100%; background: none; cursor: pointer; font-family: inherit; }

/* Ratings, price comparison, reviews (customer) */
.rk-rating { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--wash); font-size: 13px; font-weight: 800; vertical-align: middle; color: var(--ink); }
.rk-rating.big { font-size: 26px; background: none; padding: 0; }
.rk-deal {
	position: absolute; right: 12px; top: 12px; padding: 4px 10px 2px; border-radius: 4px; transform: rotate(2deg);
	background: var(--leaf-ink); color: #fff; font-weight: 800; font-size: 14px; border: 1px solid var(--line);
}
.rk-deal.inline { position: static; display: inline-block; transform: none; margin: 8px 0 0; }
.rk-cmp h3 { margin-top: 0; }
.rk-cmp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent); }
.rk-cmp-row.mine b { font-size: 22px; }
.rk-cmp-row small { color: var(--ink-2); font-size: 12px; }
.rk-review { padding: 10px 0; border-top: 2px dashed color-mix(in srgb, var(--ink) 15%, transparent); }
.rk-review p { margin: 4px 0; }
.rk-review img { max-width: 140px; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; }
.rk-stars { color: var(--mustard-deep); letter-spacing: 2px; }
.rk-rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.rk-rate-stars { display: flex; gap: 2px; }
.rk-rate-stars button {
	width: 44px; height: 44px; border: 0; background: none; font-size: 32px; line-height: 1; cursor: pointer;
	color: color-mix(in srgb, var(--ink) 22%, transparent);
}
.rk-rate-stars button.on { color: var(--mustard-deep); }
.rk-rate-stars button:disabled { cursor: default; }

/* Payment choice cards */
.rk-pay { display: grid; gap: 8px; }
.rk-pay label { position: relative; margin: 0; }
.rk-pay input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rk-pay span {
	display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px; padding: 10px 14px;
	border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
}
.rk-pay b { font-size: 18px; }
.rk-pay small { color: var(--ink-2); font-size: 13px; }
.rk-pay input:checked + span { background: var(--mustard); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.rk-pay input:checked + span small { color: #5b4638; }
.rk-pay label:has(input:focus-visible) span { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Parcel label + certificate links (farmer) */
.kf-label-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.kf-label-qr { width: 96px; height: 96px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; flex: 0 0 auto; }
.kf-label-row .rk-btn { margin: 0; flex: 1; font-size: 17px; }
.kf-cert { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 44px; font-weight: 700; color: var(--leaf-ink); text-decoration: none; }
.kf-cert svg { width: 22px; height: 22px; }

/* ======================================================================
 * Clean market components (v2). These come last and set the look:
 * green = buy, white cards, soft shadows, mustard only for brand accents.
 * ====================================================================== */
.rk-top { border-bottom: 0; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.rk-icon-btn { background: rgba(255, 255, 255, .9); border: 0; box-shadow: none; }
.rk-badge { border: 2px solid var(--mustard); background: var(--chili-bright); }

.rk-btn {
	background: var(--leaf); color: #fff; border: 0; box-shadow: 0 2px 6px rgba(31, 122, 53, .25);
	font-stretch: 95%; border-radius: 14px;
}
.rk-btn.leaf { background: var(--leaf); color: #fff; }
.rk-btn.accent { background: var(--mustard); color: var(--on-accent); box-shadow: none; }
.rk-btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.rk-btn.danger { background: var(--paper); color: var(--chili); border: 1px solid color-mix(in srgb, var(--chili) 45%, transparent); box-shadow: none; }
.rk-btn:active { transform: scale(.98); box-shadow: none; }
.rk-card { border: 0; box-shadow: var(--shadow); }
input, select, textarea { border: 1px solid var(--line-strong); }
.rk-chip { border: 1px solid var(--line); background: var(--paper); }
.rk-chip.on { background: var(--leaf-wash); border-color: var(--leaf); color: var(--leaf-ink); box-shadow: none; }

/* Bottom navigation: white bar, green active, green post button */
.rk-tabs {
	left: 0; right: 0; bottom: 0; max-width: none; border-radius: 0; padding: 4px 8px calc(4px + var(--sab));
	background: var(--paper); box-shadow: 0 -1px 0 var(--line), 0 -6px 20px rgba(16, 24, 20, .06); border: 0 !important;
}
.rk-tabs a { color: var(--ink-2); }
.rk-tabs a.on { color: var(--leaf); }
.rk-tabs .rk-post-btn { background: var(--leaf); color: #fff; border: 4px solid var(--paper); box-shadow: 0 4px 12px rgba(31, 122, 53, .35); }
.rk-tabs .rk-post-btn.on { background: var(--leaf); color: #fff; }
body.rk-detail .rk-tabs, body.rk-farmer-mode .rk-tabs { display: none; }
body.rk-detail, body.rk-farmer-mode { padding-bottom: calc(96px + var(--sab)); }
body.rk-farmer-mode #rk-cart-link, body.rk-farmer-mode .rk-top a[href="#/cart"] { display: none; }

/* Product card: photo → name + price → seller → tags → buy row */
.rk-feed { gap: 16px; }
.rk-product { padding: 0; overflow: hidden; margin: 0; }
.rk-product .rk-photo { border: 0; border-radius: 0; box-shadow: none; aspect-ratio: 1 / 1; }
.rk-product-body { padding: 12px 14px 14px; }
.rk-product-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.rk-product-title b, .rk-product-title h1 { font-size: 22px; font-weight: 800; font-stretch: 85%; margin: 0; }
.rk-price-big { font-size: 22px; font-weight: 800; font-stretch: 85%; color: var(--leaf-ink); white-space: nowrap; }
.rk-price-big small { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.rk-seller { margin: 2px 0 8px; color: var(--ink-2); font-size: 14px; }
.rk-verified {
	position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px;
	padding: 4px 10px 3px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--leaf-ink);
	font-size: 13px; font-weight: 800; box-shadow: var(--shadow-sm);
}
.rk-verified svg { width: 14px; height: 14px; }
.rk-deal { position: absolute; right: 10px; top: 10px; left: auto; transform: none; border: 0; border-radius: 999px; padding: 4px 10px 3px; background: var(--mustard); color: var(--on-accent); font-size: 13px; }
.rk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.rk-tags span { padding: 3px 10px 2px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rk-buy { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.rk-add-btn { margin: 0; min-height: 50px; font-size: 17px; }
.rk-in-cart { margin: 8px 0 0; font-size: 14px; color: var(--leaf-ink); font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rk-in-cart svg { width: 16px; height: 16px; }

/* Quantity stepper that shows the unit */
.rk-qty { display: flex; align-items: center; height: 50px; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--paper); }
.rk-qty button { width: 44px; height: 100%; border: 0; background: none; font-size: 24px; font-weight: 700; color: var(--leaf-ink); cursor: pointer; }
.rk-qty button:active { background: var(--leaf-wash); }
.rk-qty output { min-width: 74px; text-align: center; font-size: 15px; font-weight: 600; white-space: nowrap; }
.rk-qty output b { font-size: 19px; font-weight: 800; }

/* Product page */
.rk-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.rk-gallery {
	position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 1 / 1;
	margin: 0 -16px; background: var(--paper);
}
.rk-gallery img, .rk-gallery video { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.rk-detail-head { background: var(--paper); margin: 0 -16px 16px; padding: 14px 16px; box-shadow: 0 1px 0 var(--line); }
.rk-detail-head .rk-product-title h1 { font-size: 28px; }
.rk-detail-head .rk-price-big { font-size: 26px; }
.rk-cert-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--leaf-ink); }
.rk-cert-link svg { width: 18px; height: 18px; }
.rk-buybar {
	position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
	padding: 10px 16px calc(10px + var(--sab)); background: var(--paper);
	box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(16, 24, 20, .08);
}
.rk-buybar .rk-btn { margin: 0; min-height: 54px; font-size: 17px; }
.rk-buybar p { grid-column: 1 / -1; text-align: center; margin: 8px 0; }

/* Composer: tags after the photo, Nepali-digit number displays */
.rk-tagbox { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 14px 0 0; }
.rk-tagbox h3 { margin: 0; }
.rk-tagbox > p { margin: 2px 0 4px; }
.rk-taggroup { margin-top: 12px; }
.rk-taggroup legend { font-size: 15px; font-weight: 800; }
.rk-taggroup.is-quality { background: var(--wash); border-radius: 12px; padding: 4px 10px 10px; }
.rk-tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-tagpick label { position: relative; margin: 0; }
.rk-tagpick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rk-tagpick span {
	display: inline-flex; align-items: center; min-height: 46px; padding: 8px 16px 6px; border-radius: 999px;
	border: 1px solid var(--line-strong); background: var(--paper); font-size: 16px; font-weight: 700; cursor: pointer;
}
.rk-tagpick input:checked + span { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.rk-tagpick input:checked + span::before { content: "✓ "; }
.rk-tagpick label:has(input:focus-visible) span { outline: 3px solid var(--sky); outline-offset: 2px; }
.rk-num {
	display: flex; align-items: baseline; justify-content: center; gap: 6px; height: 56px; border-radius: 14px;
	border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; font-family: inherit;
}
.rk-num b { font-size: 26px; font-weight: 800; }
.rk-num span { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.rk-num.empty b, .rk-num b:only-child { font-size: 18px; color: var(--leaf-ink); }
.rk-stepper { grid-template-columns: 56px 1fr 56px; }
.rk-stepper > button:not(.rk-num) { border: 1px solid var(--line-strong); box-shadow: none; color: var(--leaf-ink); }
.rk-capture { border: 2px dashed var(--line-strong); background: var(--paper); }
.rk-crop-pick label { border: 1px solid var(--line); background: var(--paper); }
.rk-crop-pick label:has(input:checked) { background: var(--leaf-wash); border-color: var(--leaf); color: var(--leaf-ink); box-shadow: none; }
.rk-chips-row span { border: 1px solid var(--line-strong); }
.rk-chips-row input:checked + span { background: var(--leaf); border-color: var(--leaf); color: #fff; box-shadow: none; }
.rk-pay span { border: 1px solid var(--line-strong); background: var(--paper); }
.rk-pay input:checked + span { background: var(--leaf-wash); border-color: var(--leaf); color: var(--ink); box-shadow: none; }

/* Farmer area in the clean look */
.kf-subnav a { border: 1px solid var(--line); box-shadow: none; }
.kf-subnav a.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.kf-next { border: 0; box-shadow: var(--shadow); }
.kf-next.tone-action { background: var(--mustard); }
.kf-order, .kf-post { border: 0; box-shadow: var(--shadow); background: var(--paper); }
.kf-order.is-new { box-shadow: 0 0 0 3px var(--mustard), var(--shadow); }
.kf-yesno button { border: 0; box-shadow: 0 2px 8px rgba(16, 24, 20, .15); }
.kf-yes { background: var(--leaf); }
.kf-no { border: 2px solid var(--chili) !important; box-shadow: none !important; }
.kf-money { border: 0; box-shadow: var(--shadow); background: var(--paper); }
.kf-money span { border-right: 1px solid var(--line); }
.kf-track li.now i, .kf-journey li.now > i { border: 3px solid var(--mustard-deep); }
.kf-sheet { border: 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
.kf-keys button { border: 1px solid var(--line-strong); box-shadow: none; }
.kf-call { border: 1px solid var(--line-strong); background: var(--paper); }
.kf-actions button { border: 1px solid var(--line-strong); }
.rk-buybar .rk-add-btn { justify-content: space-between; padding: 10px 16px; white-space: nowrap; }
.rk-buybar .rk-add-btn b { font-size: 20px; font-weight: 800; }
.rk-add-btn svg { width: 20px; height: 20px; }

/* Farmer v2 pieces: compact rows, parcels, undo, stories */
.kf-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 10px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; min-height: 64px; }
.kf-row.is-dead { opacity: .65; }
.kf-row .kf-icons img { width: 40px; height: 40px; }
.kf-row .kf-what b { font-size: 17px; }
.kf-row .kf-amt { font-size: 18px; }
.kf-next-money { font-size: 34px !important; font-weight: 800; font-stretch: 80%; margin: 2px 0 4px !important; }
.kf-drop { background: color-mix(in srgb, var(--paper) 72%, transparent); }  /* readable in dark mode too */
.kf-drop-where { font-size: 19px !important; }
.kf-parcel { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--line-strong); }
.kf-parcel span { display: flex; flex-direction: column; min-width: 0; }
.kf-parcel small { color: var(--ink-2); font-size: 13px; }
.kf-parcel a { font-weight: 700; color: var(--leaf-ink); min-height: 32px; display: inline-flex; align-items: center; }
.kf-code-big { font-size: 34px; font-weight: 800; letter-spacing: .04em; line-height: 1.1; }
.kf-label-qr { width: 84px; height: 84px; border: 1px solid var(--line-strong); }
.kf-undo { margin-left: 10px; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 0; background: var(--mustard); color: var(--on-accent); font-weight: 800; font-family: inherit; cursor: pointer; }
#rk-toast { display: flex; align-items: center; justify-content: space-between; }
.kf-links { display: grid; gap: 8px; margin-top: 8px; }
.kf-links .kf-call { margin: 0; }
.kf-story { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 12px 14px; margin: 0 0 12px; }
.kf-story.unseen { box-shadow: inset 4px 0 0 var(--chili-bright), var(--shadow-sm); }
.kf-story-head { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.kf-story-head img { width: 48px; height: 48px; object-fit: contain; }
.kf-story-head b { display: block; font-size: 18px; font-weight: 800; }
.kf-story-head small, .kf-story-body { color: var(--ink-2); }
.kf-story-body { margin: 6px 0 0 60px; }
.kf-journey.mini { margin: 10px 0 0; }
.kf-journey.mini li > i { width: 32px; height: 32px; }
.kf-journey.mini::before { left: 15px; }
.kf-journey.mini b { font-size: 15px; }
.kf-track li { font-size: 13px; }
.kf-speak { min-height: 48px; }

/* Registration: ward buttons + document camera tiles */
.rk-wards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rk-wards label { position: relative; margin: 0; }
.rk-wards input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rk-wards span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; }
.rk-wards b { font-size: 26px; font-weight: 800; line-height: 1; }
.rk-wards small { font-size: 12px; color: var(--ink-2); }
.rk-wards input:checked + span { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.rk-wards input:checked + span small { color: #e5f3e5; }
.rk-wards label:has(input:focus-visible) span { outline: 3px solid var(--sky); outline-offset: 2px; }
.rk-doc-tile { display: block; margin: 16px 0 0; cursor: pointer; }
.rk-doc-tile > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 12px; text-align: center; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--bg); }
.rk-doc-tile.small > span { min-height: 90px; }
.rk-doc-tile svg { width: 44px; height: 44px; color: var(--leaf-ink); }
.rk-doc-tile b { font-size: 18px; }
.rk-doc-tile small { color: var(--ink-2); }
.rk-doc-tile img { max-height: 120px; border-radius: 10px; }
.rk-chips-row span img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: 4px; }

/* Alignment pass (360px device audit) */
.rk-brand { min-height: 44px; align-items: center; }
.rk-product-title { min-height: 44px; align-items: center; }
.rk-sep { font-style: normal; display: inline-block; margin: 0 6px; color: var(--line-strong); }
.kf-money span { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; justify-content: center; }
.kf-money small { line-height: 1.3; }
summary { min-height: 44px; display: flex; align-items: center; gap: 12px; list-style: none; }
summary::-webkit-details-marker { display: none; }
/* flex drops the native ▶ marker, so draw a chevron that turns when open */
summary::after {
	content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin: -4px 6px 0 auto;
	border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg);
}
details[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
/* Timeline story: centre the event circles (32px) under the header icon (48px) */
.kf-story-head { gap: 14px; }
.kf-story-head img, .kf-story-head > i { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; }
.kf-journey.mini { margin-left: 8px; }
.kf-journey.mini li { gap: 22px; }
.kf-story-body { margin-left: 62px; }
/* Category chips: icon + label on one line */
.rk-chips-row span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 14px 4px 10px; }
.rk-chips-row span img { margin: 0; width: 26px; height: 26px; }
/* Number displays: centred, empty state is a small green hint */
.rk-num { align-items: center; line-height: 1; padding: 0 8px; }
.rk-num b, .rk-num span { line-height: 1; }
.rk-num.empty b { font-size: 18px; color: var(--leaf-ink); font-weight: 800; }
.rk-num.empty span { display: none; }
#rk-cats label, #rk-subcats label { flex: 0 0 auto; }
/* Basket rows: icon · name/qty/farmer · amount · remove */
.rk-cart-row { display: grid; grid-template-columns: 40px 1fr auto 44px; gap: 10px; align-items: center; padding: 8px 0; }
.rk-cart-row + .rk-cart-row { border-top: 1px solid var(--line); }
.rk-cart-row img { width: 40px; height: 40px; object-fit: contain; }
.rk-cart-what { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rk-cart-what b { font-size: 17px; }
.rk-cart-what small { color: var(--ink-2); font-size: 13px; }
.rk-cart-amt { font-size: 17px; white-space: nowrap; }
.rk-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; }
.rk-x:active { background: var(--bg); }
.rk-x { display: grid; place-items: center; padding: 0 0 3px; font-family: system-ui, sans-serif; }
.rk-add-btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
#rk-toles { margin-top: 14px; } #rk-toles #rt { margin-top: 10px; }
/* Logo tile in the app bar (white, so the mustard sun reads on the mustard bar) */
.rk-logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.rk-brand { gap: 10px; }

/* ======================================================================
 * Farmer growth (farmer.js): palika verification card, crop review on posts,
 * post views, weekly earnings bars, live stock value, "posted" confirmation.
 * ====================================================================== */
/* Verification card: the farmer journey list with the current step expanded */
.kf-verify { padding: 18px 16px 16px; margin-bottom: 16px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.kf-verify.is-bad { box-shadow: 0 0 0 2px var(--chili), var(--shadow); }
.kf-verify h2 { font-size: 26px; margin: 4px 0 10px; }
.kf-vsteps { margin: 0; }
.kf-vsteps li.now > div > p { font-size: 17px; font-weight: 700; color: var(--ink); }
.kf-wait {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 10px 3px; border-radius: 999px;
	background: var(--wash); color: var(--ink) !important; font-size: 14px !important; font-weight: 700; line-height: 1.3;
}
.kf-wait svg { width: 16px; height: 16px; flex: 0 0 auto; }
.kf-journey li.failed > i, .kf-track li.failed i { background: var(--paper); border: 2px solid var(--chili); color: var(--chili); }
.kf-journey li.failed:not(.done), .kf-track li.failed:not(.done) { color: var(--chili); font-weight: 800; }
.kf-reason {
	display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; padding: 8px 10px; border-radius: 10px;
	background: color-mix(in srgb, var(--chili) 10%, var(--paper)); color: var(--chili); font-weight: 700;
}
.kf-reason svg { width: 20px; height: 20px; flex: 0 0 auto; }
.kf-verify-note { margin: 10px 0 0; color: var(--ink-2); }
.kf-verify .kf-call { margin-top: 12px; }

/* Missing papers: one-tap camera tiles */
.kf-need { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.kf-need > p { margin: 0 0 10px; font-size: 16px; }
.kf-snaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kf-snap { display: block; margin: 0; cursor: pointer; }
.kf-snap > span {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 124px; padding: 10px;
	text-align: center; border: 2px dashed var(--leaf-ink); border-radius: 16px; background: var(--leaf-wash); color: var(--ink);
}
.kf-snap svg { width: 40px; height: 40px; color: var(--leaf-ink); }
.kf-snap b { font-size: 17px; line-height: 1.2; }
.kf-snap small { font-size: 13px; color: var(--ink-2); }
.kf-snap img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.kf-snap.busy > span { opacity: .7; pointer-events: none; }
.kf-snap:has(input:focus-visible) > span { outline: 3px solid var(--sky); outline-offset: 2px; }
.kf-snap:active > span { background: var(--mustard); color: var(--on-accent); }

/* Waiting posts: compact crop-approval tracker */
.kf-review { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.kf-track-n { grid-template-columns: repeat(var(--n), 1fr); margin: 8px 0 2px; }
.kf-track-n::before { top: 15px; }
.kf-track-n li { font-size: 12px; }
.kf-track-n i { width: 32px; height: 32px; }
.kf-track-n i svg { width: 17px; height: 17px; }
.kf-review-now { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 15px; }
.kf-review-now svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.kf-review-farmer {
	display: flex; gap: 8px; align-items: center; margin-top: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px;
	background: var(--wash); color: var(--ink); text-decoration: none; font-weight: 700;
}
.kf-review-farmer svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--leaf-ink); }
.kf-review .kf-call { margin-top: 10px; }

/* Post views: "👁 २४ जनाले हेरे" */
.kf-post-top > div { flex: 1; min-width: 0; }
.kf-views { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; min-width: 56px; line-height: 1.1; color: var(--ink); }
.kf-views svg { width: 22px; height: 22px; color: var(--sky); }
.kf-views b { font-size: 20px; font-weight: 800; }
.kf-views small { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.kf-views-line { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.kf-views-line svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--sky); }
.kf-views-line b { font-size: 18px; font-weight: 800; color: var(--ink); margin: 0 2px 0 0; }
.kf-live-img { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; object-fit: cover; }
.kf-live-img.icon { object-fit: contain; background: var(--wash); }
.kf-more { display: flex; align-items: center; min-height: 44px; margin: -4px 0 8px; font-weight: 700; color: var(--leaf-ink); text-decoration: none; }

/* Money: this week + 8 weekly bars (heights from --p = amount / best week) */
.kf-week { padding: 16px; margin: 0 0 16px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.kf-week-name { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink-2); }
.kf-week-amt { margin: 2px 0 0; font-size: 40px; font-weight: 800; font-stretch: 80%; line-height: 1.1; color: var(--leaf-ink); }
.kf-week-dates { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.kf-bars { display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; height: 150px; margin: 0 -8px; }
.kf-bar {
	display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; padding: 0 3px;
	border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; cursor: pointer;
}
.kf-bar i {
	display: block; height: calc((100% - 22px) * var(--p)); min-height: 4px; border-radius: 8px 8px 3px 3px;
	background: color-mix(in srgb, var(--leaf) 35%, var(--paper));
}
.kf-bar span { font-size: 12px; line-height: 18px; text-align: center; white-space: nowrap; }
.kf-bar.is-now i { background: var(--leaf); }
.kf-bar.on i { box-shadow: 0 0 0 3px var(--mustard); }
.kf-bar.on span { color: var(--ink); font-weight: 800; }
.kf-bar:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }
.kf-bars-note { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }

/* Money: value of what is still on the market */
.kf-stock {
	display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px;
	background: var(--leaf-wash); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
}
.kf-stock > i { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: var(--paper); color: var(--leaf-ink); }
.kf-stock > i svg { width: 26px; height: 26px; }
.kf-stock > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.kf-stock b { font-size: 28px; font-weight: 800; font-stretch: 80%; color: var(--leaf-ink); }
.kf-stock small { font-size: 13px; color: var(--ink-2); font-weight: 600; }

/* After posting: big tick, the post, what it brings in */
.kf-posted { text-align: center; padding-top: 4px; }
.kf-posted-tick {
	display: grid; place-items: center; width: 96px; height: 96px; margin: 8px auto 4px; border-radius: 50%;
	background: var(--leaf); color: #fff; box-shadow: 0 0 0 10px var(--leaf-wash); animation: kf-pop .45s ease-out;
}
.kf-posted.is-wait .kf-posted-tick { background: var(--mustard); color: var(--on-accent); box-shadow: 0 0 0 10px var(--wash); }
.kf-posted-tick svg { width: 56px; height: 56px; }
.kf-posted h2 { font-size: 32px; margin: 16px 0 10px; }
.kf-posted-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); text-align: left; }
.kf-posted-card img { width: 84px; height: 84px; flex: 0 0 84px; border-radius: 12px; object-fit: cover; }
.kf-posted-card img.icon { object-fit: contain; background: var(--wash); }
.kf-posted-card p { margin: 0; min-width: 0; }
.kf-posted-card b { display: block; font-size: 22px; font-weight: 800; }
.kf-posted-card span { font-size: 16px; color: var(--ink-2); }
.kf-posted-money { display: flex; flex-direction: column; align-items: center; margin: 12px 0 0; line-height: 1.15; }
.kf-posted-money span { font-size: 18px; font-weight: 700; }
.kf-posted-money small { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.kf-posted-money b { font-size: 40px; font-weight: 800; font-stretch: 80%; color: var(--leaf-ink); }
.kf-posted + .kf-big-post { margin-top: 16px; }
.kf-posted-note {
	display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
	background: var(--leaf-wash); font-weight: 700; text-align: left;
}
.kf-posted-note.is-wait { background: var(--wash); }
.kf-posted-note svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--leaf-ink); }
@keyframes kf-pop { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kf-posted-tick { animation: none; } }

/* Wide screens (laptop, projector): keep the bars on the same 560px column as the content */
@media (min-width: 640px) {
	.rk-top { padding-left: max(16px, calc(50vw - 280px)); padding-right: max(16px, calc(50vw - 280px)); }
	.rk-tabs, .rk-buybar { left: 50%; right: auto; width: 100%; max-width: 592px; transform: translateX(-50%); border-radius: 18px 18px 0 0; }
}
/* The verified pill sits on a white chip over the photo in both themes: fixed dark-green ink */
.rk-verified { color: #14532d; }
/* Keyboard open: hide the bars that would float over the form (kisan.js sets rk-typing) */
body.rk-typing .rk-tabs, body.rk-typing .sh-pill, body.rk-typing .rk-buybar { display: none; }
