/* Order care (care.js): order detail timeline, problem reports. Loaded after kisan.css;
 * colours come from the kisan.css :root tokens only, so light and dark both work. */

/* ---------- order list → detail ---------- */
.rc-order-head { display: block; color: inherit; text-decoration: none; margin: -4px 0 0; }
.rc-order-more {
	display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 8px 0 -6px;
	font-weight: 700; color: var(--leaf-ink); text-decoration: none; border-top: 1px solid var(--line);
}
.rc-order-more span:last-child { font-size: 22px; line-height: 1; }

/* ---------- order detail ---------- */
.rc-head { margin: 4px 0 0; }
.rc-head h2 { margin: 8px 0 4px; }
.rc-head p { margin: 0; }

/* Vertical timeline: done = green tick + time, now = mustard ring + explanation, todo = grey */
.rc-track { list-style: none; margin: 0; padding: 0; position: relative; }
.rc-track::before {
	content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px;
	background: color-mix(in srgb, var(--ink) 15%, transparent);
}
.rc-step { position: relative; display: flex; gap: 12px; padding: 6px 0; }
.rc-step > i {
	position: relative; z-index: 1; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
	display: grid; place-items: center; font-style: normal;
	background: var(--paper); border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); color: var(--ink-2);
}
.rc-step > i svg { width: 16px; height: 16px; }
.rc-step > div { flex: 1; min-width: 0; padding-top: 4px; }
.rc-step b { display: block; font-size: 17px; font-weight: 700; line-height: 1.25; }
.rc-step small { display: block; color: var(--ink-2); font-size: 13px; }
.rc-step.is-done > i { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.rc-step.is-now > i {
	background: var(--mustard); border-color: var(--mustard); color: var(--on-accent);
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--mustard) 35%, transparent);
}
.rc-step.is-now b { font-size: 19px; font-weight: 800; }
.rc-step.is-todo { color: var(--ink-2); }
.rc-step.is-todo b { font-weight: 600; }
.rc-step.is-bad > i { background: var(--paper); border-color: var(--chili); color: var(--chili); }
.rc-step.is-bad b { color: var(--chili); }
.rc-actor {
	display: inline-block; margin: 4px 0 0; padding: 2px 10px 1px; border-radius: 999px;
	background: var(--wash); color: var(--ink); font-size: 13px; font-weight: 700;
}
.rc-explain { margin: 6px 0 2px; padding: 10px 12px; border-radius: 12px; background: var(--wash); color: var(--ink); font-size: 16px; line-height: 1.45; }
.rc-explain.bad { background: transparent; border: 1px solid color-mix(in srgb, var(--chili) 40%, transparent); }

.rc-pay { margin: 0 0 16px; }

/* Problem report status card */
.rc-issue { border-left: 4px solid var(--mustard); }
.rc-issue[data-s="Resolved"] { border-left-color: var(--leaf); }
.rc-issue[data-s="Rejected"] { border-left-color: var(--chili); }
.rc-issue .rk-row { margin-top: 0; }
.rc-issue .rk-row b { display: inline-flex; align-items: center; gap: 6px; }
.rc-issue .rk-row svg { width: 20px; height: 20px; }
.rc-issue p { margin: 6px 0 0; }
.rc-issue-what { font-weight: 600; }
.rc-pill {
	display: inline-block; padding: 3px 10px 1px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
	background: var(--wash); color: var(--ink); border: 1px solid var(--line);
}
.rc-pill[data-s="Resolved"] { background: var(--leaf-wash); color: var(--leaf-ink); }
.rc-pill[data-s="Rejected"] { background: transparent; color: var(--chili); border-color: var(--chili); }

/* Items grouped by farmer */
.rc-items h3, .rc-help h3 { margin-top: 0; }
.rc-farmer + .rc-farmer { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.rc-farmer-link { display: flex; align-items: center; gap: 10px; min-height: 48px; color: var(--ink); text-decoration: none; }
.rc-farmer-link > span:nth-child(2) { flex: 1; min-width: 0; }
.rc-farmer-link b { display: block; font-weight: 800; }
.rc-farmer-link small { color: var(--leaf-ink); font-size: 13px; font-weight: 600; }
.rc-farmer-link svg { width: 20px; height: 20px; color: var(--ink-2); flex: 0 0 auto; }
.rc-avatar {
	flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
	background: var(--leaf-wash); color: var(--leaf-ink); font-weight: 800; font-size: 18px;
}
.rc-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.rc-item img { width: 40px; height: 40px; object-fit: contain; }
.rc-item-what { min-width: 0; }
.rc-item-what b { display: block; }
.rc-item-what small { color: var(--ink-2); font-size: 13px; }
.rc-amt { white-space: nowrap; }
.rc-item.is-out { opacity: .6; }
.rc-item.is-out .rc-amt { text-decoration: line-through; }
.rc-total b { font-size: 18px; }
.rc-refund { margin: 4px 0 0; color: var(--leaf-ink); font-weight: 700; }
.rc-address { margin: 0; white-space: pre-line; }

/* Help: Walmart-style "Need to make a change?" rows */
.rc-help-row {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; margin: 0;
	border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none;
	text-align: left; cursor: pointer; font: inherit;
}
.rc-help h3 + .rc-help-row { border-top: 0; }
.rc-help-row > svg:first-child { width: 26px; height: 26px; flex: 0 0 auto; color: var(--leaf-ink); }
.rc-help-row > span { flex: 1; min-width: 0; }
.rc-help-row b { display: block; font-size: 17px; font-weight: 800; }
.rc-help-row small { display: block; color: var(--ink-2); font-size: 13px; }
.rc-help-row > svg:last-child:not(:first-child) { width: 20px; height: 20px; color: var(--ink-2); flex: 0 0 auto; }
.rc-help-row.danger > svg:first-child, .rc-help-row.danger b { color: var(--chili); }
.rc-help-row.plain { border-top: 0; justify-content: center; }
.rc-help-row.plain > span { flex: 0 1 auto; }
.rc-help-note { margin: 0 0 8px; color: var(--ink-2); }

/* ---------- problem report ---------- */
.rc-block { margin-top: 20px; }
.rc-block legend { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.rc-block legend small { font-size: 14px; font-weight: 600; }
.rc-pick { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); margin: 0 0 8px; }
.rc-pick.on { border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf); }
.rc-pick-head { display: flex; align-items: center; gap: 10px; min-height: 60px; margin: 0; padding: 8px 12px; cursor: pointer; }
.rc-pick-head input { flex: 0 0 auto; width: 26px; height: 26px; margin: 0; padding: 0; accent-color: var(--leaf); }
.rc-pick-head img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.rc-pick-head span { min-width: 0; }
.rc-pick-head b { display: block; font-size: 18px; }
.rc-pick-head small { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.rc-pick-qty { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 12px; font-weight: 700; }
.rc-pick-qty[hidden] { display: none; }

.rc-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-kinds label { position: relative; margin: 0; }
.rc-kinds label:first-child { grid-column: 1 / -1; }
.rc-kinds input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.rc-kinds span {
	display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
	border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
}
.rc-kinds svg { width: 28px; height: 28px; flex: 0 0 auto; color: var(--ink-2); }
.rc-kinds b { font-size: 17px; font-weight: 800; line-height: 1.2; }
.rc-kinds input:checked + span { background: var(--leaf-wash); border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf); color: var(--leaf-ink); }
.rc-kinds input:checked + span svg { color: var(--leaf-ink); }
.rc-kinds label:has(input:focus-visible) span { outline: 3px solid var(--sky); outline-offset: 2px; }

.rc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc-photo, .rc-photo-add { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; margin: 0; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-photo button {
	position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
	display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 70%, transparent); color: var(--paper);
}
.rc-photo button svg { width: 18px; height: 18px; }
.rc-photo-add {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; cursor: pointer;
	border: 2px dashed var(--line-strong); background: var(--paper); color: var(--leaf-ink); text-align: center;
}
.rc-photo-add svg { width: 32px; height: 32px; }
.rc-photo-add b { font-size: 14px; line-height: 1.2; }
.rc-photo-add:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Sent */
.rc-done { text-align: center; padding: 16px 0 0; }
.rc-done h2 { margin: 12px 0 4px; }
.rc-done p { margin: 0; font-size: 18px; }
.rc-done-mark {
	display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
	background: var(--leaf); color: #fff;
}
.rc-done-mark svg { width: 38px; height: 38px; }
.rc-right { text-align: right; }
