/* Surkora view styles: field, assistant, CUE logbook, farm and co-op. Loaded after components.css. */

/* Field: pin, leaf diagnosis, soil, mix */
.pin-card { flex-direction: row; align-items: center; gap: 12px; }
.pin-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px 4px 14px 4px;
  background: var(--risk-tint);
  color: var(--risk);
}
.pin-card.calm .pin-ico { background: var(--mint-tint); color: var(--emerald); }
.pin-card.calm > .btn { display: none; }
.pin-body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.pin-body h2 { font-size: 16px; }
.pin-body p { color: var(--muted); font-size: 14px; }
@media (max-width: 599px) {
  .pin-card { flex-wrap: wrap; }
  .pin-card > .btn { flex: 1 1 100%; }
}

.photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-actions .btn { min-width: 0; min-height: 56px; line-height: 1.2; text-align: center; white-space: normal; cursor: pointer; }
.btn-photo { min-height: 56px; border-color: var(--emerald); background: var(--emerald); color: var(--cream); cursor: pointer; }
.btn-photo:hover { background: var(--pine); }
.btn-photo .ic { width: 22px; height: 22px; }

.diag {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}
.diag img { width: 88px; height: 88px; border-radius: var(--radius-sm); background: var(--line); object-fit: cover; }
.diag h3,
.diag p { grid-column: 1 / -1; }
.diag h3 { color: var(--ink); font-size: 15px; }
.diag-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 52px; align-items: center; gap: 8px; font-size: 13px; }
.bar-row b { font-weight: 600; text-align: right; }
.bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.bar i { display: block; height: 100%; transition: width 0.5s var(--spring); }
.b-green { background: var(--leaf); }
.b-yellow { background: var(--gold); }
.b-brown { background: #7a4e0e; }

.grid2,
.grid3 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }

.result {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
  font-size: 14px;
}
.result.ok { border-color: #bfe0cb; background: var(--mint-tint); }
.result.warn { border-color: #ebd27a; background: var(--gold-tint); }
.result p + p,
.result p + ul,
.result ul + p { margin-top: 6px; }
.res-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; }
.res-head .ic { width: 18px; height: 18px; }
.result.ok .res-head { color: var(--emerald); }
.result.warn .res-head { color: var(--gold-text); }
.result .btn-outline { margin-top: 8px; }

.score-rules { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.score-rules li { padding: 6px 10px; border-radius: 8px; background: var(--surface); }
.score-rules li.on { border-left: 3px solid var(--leaf); }
.score-rules li.off { border-left: 3px solid var(--line); color: var(--muted); }

/* Assistant */
.mic-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.mic-btn:hover { border-color: var(--emerald); }
.mic-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--emerald);
  color: var(--cream);
}
.mic-ring .ic { width: 24px; height: 24px; }
.mic-btn.listening { border-color: var(--risk); background: var(--risk-tint); }
.mic-btn.listening .mic-ring { background: var(--risk); }
.mic-btn.listening .mic-ring::after {
  position: absolute;
  inset: -6px;
  border: 2px solid var(--risk);
  border-radius: 50%;
  content: "";
  animation: mic-pulse 1.2s ease-out infinite;
}
@keyframes mic-pulse {
  from { opacity: 0.8; transform: scale(0.92); }
  to { opacity: 0; transform: scale(1.3); }
}
.mic-interim { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--sunken); color: var(--muted); font-style: italic; }

.quick-prompts { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; scrollbar-width: none; }
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-prompts .chip-btn { flex: none; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
.inline-form .btn { flex: none; }

.feed { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.bubble-pair { display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: var(--radius); font-size: 14.5px; white-space: pre-line; }
.bubble.q { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--emerald); color: var(--cream); }
.bubble.q small { display: block; margin-top: 3px; font-size: 11.5px; opacity: 0.8; }
.bubble.a { align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--surface); }

/* CUE logbook */
.cue-summary { display: flex; flex-direction: column; gap: 4px; }
.cue-summary h1 { font-size: 24px; letter-spacing: -0.02em; }
.cue-summary p { color: var(--muted); font-size: 14px; }
.cue-form { display: flex; flex-direction: column; gap: 12px; }
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sunken);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: grid !important;
  place-items: center;
  min-height: 42px;
  margin: 0 !important;
  padding: 0 6px;
  border-radius: 11px;
  color: var(--muted) !important;
  font-size: 14px !important;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented input:checked + span { background: var(--surface); color: var(--ink) !important; font-weight: 600; box-shadow: 0 1px 2px rgba(16, 35, 26, 0.14); }
.segmented input:focus-visible + span { outline: 3px solid var(--leaf); }

.anexo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #ebd27a;
  border-radius: var(--radius);
  background: var(--gold-tint);
}
.anexo legend { padding: 0 6px; color: var(--gold-text); font-size: 13px; font-weight: 600; }
.letter { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--pine); color: var(--cream); font-size: 11px; }

.meter { display: flex; align-items: center; gap: 10px; }
.meter-bar { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.meter-bar i { display: block; width: 0; height: 100%; background: var(--gold-deep); transition: width 0.4s var(--spring); }
#anexoMeterBar.ok,
.coop-card .meter-bar i { background: var(--leaf); }

.cue-list { display: flex; flex-direction: column; gap: 8px; }
.cue-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--water);
  border-radius: 6px 14px 14px 6px;
  background: var(--surface);
}
.cue-item.fito { border-left-color: var(--gold-deep); }
.cue-item.fert { border-left-color: var(--leaf); }
.cue-item.queued { border-style: dashed; border-left-style: solid; border-left-color: var(--gold-deep); }
.cue-item.queued .cue-date .ic { width: 18px; height: 18px; }
.cue-date { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--sunken); line-height: 1.1; }
.cue-date b { font-family: var(--display); font-size: 21px; font-weight: 700; }
.cue-date small { color: var(--muted); font-size: 12px; }
.cue-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cue-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cue-del-btn { flex: none; margin: -4px -4px 0 0; }
.cue-body strong { font-size: 15px; font-weight: 600; }

/* Multi-parcel / Técnico portfolio cards */
.portfolio-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--leaf-r-sm);
  background: var(--surface);
}
.portfolio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.portfolio-head .row-main { padding: 0; text-align: left; background: none; border: 0; flex: 1; min-width: 0; cursor: pointer; }
.portfolio-head .row-main strong { display: block; font-size: 15.5px; color: var(--ink); }
.portfolio-head .row-main small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.portfolio-actions .icon-btn { margin-left: auto; }

@media (max-width: 400px) {
  .diag { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 64px 1fr 44px; font-size: 12px; }
  .hud-actions { flex-wrap: wrap; }
  .hud-actions > * { flex: 1 1 140px; }
}
.cue-body small { color: var(--muted); overflow-wrap: anywhere; }
.cue-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.miss-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px dashed var(--gold-deep);
  border-radius: var(--radius-sm);
  background: var(--gold-tint);
  color: var(--gold-text);
  font-size: 13px;
  text-align: left;
}
.miss-btn span { flex: 1; min-width: 0; }
.miss-btn em { flex: none; font-style: normal; font-weight: 600; text-decoration: underline; }
.miss-btn .ic { width: 16px; height: 16px; }

/* Farm: sub tabs as a segmented control, score, money */
.subtabs {
  position: sticky;
  top: calc(var(--appbar-h) + var(--safe-t));
  z-index: 5;
  display: flex;
  gap: 2px;
  margin: -16px -16px 0;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  scrollbar-width: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button.active { border-color: #bfe0cb; background: var(--mint-tint); color: var(--emerald); font-weight: 700; }
.subtabs .ic { width: 16px; height: 16px; }
@media (max-width: 520px) { .subtabs .ic { display: none; } }
@media (min-width: 900px) {
  .subtabs { top: 0; margin: -20px -20px 0; padding: 8px 20px; }
  /* A mouse cannot swipe the strip sideways, so on desktop the prompts wrap. */
  .quick-prompts { flex-wrap: wrap; overflow-x: visible; }
}

.score-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 12px 14px; }
.score-card .score-breakdown,
.score-card .btn-row { grid-column: 1 / -1; }
.score-ring {
  display: grid;
  place-items: center;
  align-content: center;
  width: 88px;
  height: 88px;
  border: 7px solid var(--line);
  border-radius: 50%;
  line-height: 1;
}
.score-ring span { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.score-ring small { color: var(--muted); font-size: 12px; }
.score-ring.low { border-color: var(--leaf); color: var(--emerald); }
.score-ring.medium { border-color: var(--gold); color: var(--gold-text); }
.score-ring.high { border-color: var(--risk); color: var(--risk); }
.score-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.score-body p { color: var(--muted); font-size: 14px; }
.score-card .tag { max-width: 100%; line-height: 1.3; white-space: normal; }
.score-breakdown { display: flex; flex-direction: column; gap: 6px; }
.score-breakdown details summary { cursor: pointer; }

.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 7px 8px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 400; text-align: right; white-space: nowrap; }
.data-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table tr:last-child td { border-bottom: 0; }

.money-card { gap: 8px; }
.money-big { font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
#cfoScenarios { margin-top: 4px; }

.checklist { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.checklist .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--leaf); }

/* Co-op */
.coop-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--leaf-r-sm); background: var(--surface); }
.coop-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.coop-top strong { display: block; font-size: 15px; font-weight: 600; }
.coop-top small { color: var(--muted); }
.coop-details { color: var(--muted); font-size: 14px; }
.coop-foot { display: flex; align-items: center; gap: 12px; }
.coop-foot .meter { flex: 1; font-size: 13px; }

/* Narrow phones */
@media (max-width: 380px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: 62px 1fr 46px; }
  .env-grid div { grid-template-columns: 1fr; gap: 2px; }
  .money-big { font-size: 30px; }
}

/* Land score as a short sum: rule on the left, points on the right, total underlined. */
.score-sum { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.score-sum li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.score-sum b { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-sum li.muted { color: var(--muted); }
.score-sum li.total { border-bottom: 0; color: var(--emerald); font-family: var(--display); font-size: 16px; font-weight: 700; }
