/* Панель ввода: справа на компьютере, снизу на телефоне. Форма события, очередь отправки. */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; }
.sheet-dim { position: absolute; inset: 0; background: rgba(24, 32, 74, .38); opacity: 0; transition: opacity .18s; }
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--paper); display: flex; flex-direction: column; border-radius: 24px 0 0 24px; box-shadow: -20px 0 50px rgba(30,42,85,.25); transform: translateX(30px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.sheet.wide { width: min(760px, 100%); }
.sheet-wrap.in .sheet-dim { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; opacity: 1; }
body.sheet-open { overflow: hidden; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.sheet-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sheet-head h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.sheet-head h2 svg { color: var(--dawn-ink); flex-shrink: 0; }
.sheet-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-2); }
.sheet-sub .tag { font-size: 14px; min-height: 24px; }
.sheet-x { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--ground); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { display: flex; gap: 10px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--paper); }
.sheet-foot[hidden] { display: none; }
.btn.big { flex: 1; min-height: 56px; justify-content: center; font-size: 17px; border-radius: 16px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad-ink); border-color: #E7B9B5; }
.btn.danger.sure { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn[disabled] { opacity: .6; cursor: default; }
.linkbtn { align-self: flex-start; border: 0; background: none; padding: 4px 0; color: var(--night); font-weight: 600; cursor: pointer; }

/* Выбор события — крупные кнопки со значками */
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.type-grid button { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; font-weight: 600; font-size: 16px; cursor: pointer; text-align: left; }
.type-grid button svg { color: var(--dawn-ink); flex-shrink: 0; }
.type-grid button:hover { border-color: var(--night); background: var(--ground); }

/* Поля формы */
.evform { display: flex; flex-direction: column; gap: 18px; }
.evhint { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--dawn-soft); color: var(--ink); line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 8px; }
.flabel { font-weight: 600; font-size: 15px; }
.flabel i { font-style: normal; font-weight: 400; color: var(--muted); }
.field input:not([type=checkbox]):not([type=date]), .field select { height: 50px; padding: 0 14px; border: 1px solid #C9CEE0; border-radius: 14px; background: #fff; font-size: 17px; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--night); outline: none; box-shadow: 0 0 0 3px rgba(30,42,85,.12); }
.field.bad input, .field.bad select, .field.bad .seg { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); border-radius: 14px; }
.fmsg { color: var(--bad-ink); font-weight: 600; font-size: 14px; }
.fmsg:empty { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 46px; padding: 0 16px; border: 1px solid #C9CEE0; border-radius: 14px; background: #fff; font-weight: 600; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.seg.big button { flex: 1 1 140px; min-height: 60px; font-size: 17px; }
.seg.dates button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.2; padding: 6px 14px; }
.seg.dates small { font-weight: 400; font-size: 12.5px; opacity: .75; }
.date-other { display: flex; flex-direction: column; justify-content: center; min-height: 46px; padding: 4px 12px; border: 1px dashed #C9CEE0; border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.date-other input { border: 0; padding: 0; height: auto; font-size: 13px; background: transparent; color: var(--muted); }
.date-other.on { background: var(--night); border-style: solid; border-color: var(--night); color: #fff; }
.date-other.on input { color: #DDE1F0; }
.numbox { display: flex; align-items: center; gap: 10px; }
.numbox input { max-width: 160px; }
.numbox.big input { max-width: 200px; height: 64px !important; font: 700 30px var(--display) !important; text-align: center; }
.numbox span { font-weight: 600; color: var(--muted); }
#fever.hot { color: var(--bad-ink); font-weight: 700; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--ground); font-size: 14px; cursor: pointer; }
.quick button:hover { background: var(--line); }

/* Выбор быка */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picked { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 8px 0 16px; border-radius: 14px; background: var(--night); color: #fff; }
.picked[hidden], .pickq[hidden] { display: none; }
.picked b { flex: 1; font-size: 17px; }
.unpick { border: 0; background: var(--night-2); color: #fff; border-radius: 10px; min-height: 40px; padding: 0 12px; cursor: pointer; font-weight: 600; }
.pick-list { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.pick-list:not(:empty) { border: 1px solid var(--line); margin-top: 8px; }
.pick-cap { padding: 8px 14px; font-size: 13px; color: var(--muted); background: var(--ground); }
.pick-list button { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 48px; padding: 0 14px; border: 0; border-top: 1px solid var(--line-2); background: #fff; text-align: left; font-weight: 600; cursor: pointer; }
.pick-list button span { font-weight: 400; color: var(--muted); font-size: 13px; }
.pick-list button:hover { background: var(--ground); }

/* Приплод */
.calves { display: flex; flex-direction: column; gap: 10px; }
.calf { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px auto; gap: 8px; align-items: center; }
.calf input { height: 46px !important; font-size: 16px !important; }
.dead { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* Найти корову */
.pick-big { height: 60px !important; font: 700 24px var(--mono) !important; }
.pick-res { display: flex; flex-direction: column; gap: 6px; }
.pick-res button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; }
.pick-res button small { margin-left: auto; color: var(--muted); }
.pick-res button[disabled] { opacity: .5; }

/* Очередь отправки */
.qlist { display: flex; flex-direction: column; gap: 8px; }
.qrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--ground); }
.qrow.bad { background: var(--bad-soft); }
.qrow > span { flex: 1; display: flex; flex-direction: column; }
.qrow small { color: var(--muted); }
.qrow.bad small { color: var(--bad-ink); font-weight: 600; }

@media (max-width: 700px) {
  .sheet { top: auto; left: 0; width: 100%; max-height: 94vh; border-radius: 24px 24px 0 0; transform: translateY(40px); }
  .sheet.wide { width: 100%; }
  .sheet-head { padding: 16px 16px 12px; }
  .sheet-body { padding: 14px 16px 20px; }
  .sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .type-grid button { min-height: 58px; font-size: 15px; padding: 0 12px; }
  .seg.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calf { grid-template-columns: 1fr 1fr; }
  .calf .seg { grid-column: 1 / -1; }
}
