.kac-wizard, .kac-program-view {
  font-family: -apple-system, "Segoe UI", Verdana, Arial, sans-serif;
  max-width: 860px;
  margin: 0 auto;
  color: #222;
  line-height: 1.5;
}

/* шаги */
#kac-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.kac-step {
  background: #f0f0f5;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: #666;
}
.kac-step.active {
  background: #2c4a77;
  color: #fff;
}
.kac-step.done {
  background: #d7e6ff;
  color: #2c4a77;
}

/* панели */
.kac-panel { margin-top: 6px; }

/* поля */
.kac-fields {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.kac-field { flex: 1 1 180px; min-width: 160px; display: flex; flex-direction: column; }
.kac-field-narrow { flex: 0 0 auto; min-width: 0; }
.kac-field-narrow input[type="number"] { width: 3ch; min-width: 3ch; max-width: 90px; }
.kac-field label { font-size: 13px; margin-bottom: 4px; color: #444; }
.kac-field input[type="text"],
.kac-field input[type="email"],
.kac-field input[type="number"],
.kac-field input[type="password"],
.kac-field select,
.kac-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: #222;
}

/* дни */
.kac-day {
  border: 1px solid #ccd;
  border-radius: 6px;
  margin-bottom: 14px;
  background: #fafafd;
  padding: 12px;
}
.kac-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.kac-day-head select {
  min-width: 200px;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 14px;
  background: #fff;
}
.kac-day-remove {
  background: none;
  border: 1px solid #d88;
  color: #b33;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  line-height: 1;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
}
.kac-day-remove:hover { background: #fdecec; }

.kac-radio-row { display: flex; gap: 16px; align-items: center; padding-top: 6px; }
.kac-radio { display: flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
.kac-radio input { width: auto; }
.kac-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kac-label-row > label:first-child { margin-bottom: 0; }
.kac-check { display: flex; gap: 5px; align-items: center; font-size: 12px; cursor: pointer; margin: 0; white-space: nowrap; }
.kac-check input { width: auto; }

/* таблица упражнений */
.kac-ex-head {
  display: grid;
  grid-template-columns: 1fr 110px 110px 34px;
  gap: 8px;
  margin-bottom: 4px;
}
.kac-ex-head span {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  padding: 0 2px;
}
.kac-ex-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.kac-ex-row select,
.kac-ex-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 7px 8px;
  font-size: 13px;
  background: #fff;
}
.kac-ex-remove {
  background: none;
  border: 1px solid #d88;
  color: #b33;
  border-radius: 4px;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.kac-ex-remove:hover { background: #fdecec; }
.kac-ex-add {
  margin-top: 4px;
  background: none;
  border: 1px dashed #99a;
  color: #2c4a77;
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}
.kac-ex-add:hover { background: #f0f4ff; }

/* кнопки */
.kac-btn {
  display: inline-block;
  background: #2c4a77 !important;
  color: #fff !important;
  border: 1px solid #2c4a77 !important;
  border-radius: 4px !important;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.kac-btn:hover { background: #1f3a5f !important; border-color: #1f3a5f !important; }
.kac-btn-ghost {
  background: #fff !important;
  color: #2c4a77 !important;
  border-color: #2c4a77 !important;
}
.kac-btn-ghost:hover { background: #f0f4ff !important; }
.kac-btn[disabled] { opacity: .6; cursor: not-allowed; }
.kac-nav { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.kac-back { background: #888 !important; border-color: #888 !important; }
.kac-back:hover { background: #666 !important; border-color: #666 !important; }

.kac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.kac-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fdecec;
  border: 1px solid #d88;
  border-radius: 4px;
  color: #a22;
  font-size: 14px;
}
.kac-error-inline { color: #a22; font-size: 13px; margin-left: 10px; }
.kac-counter { font-size: 12px; color: #888; margin-top: 4px; text-align: right; }
.kac-counter .over { color: #b33; font-weight: 600; }

/* успех */
.kac-success { text-align: center; padding: 10px 0; }
.kac-success h3 { color: #2c4a77; margin: 0 0 8px; }
.kac-success p { margin: 4px 0; }
.kac-creds {
  display: inline-block;
  text-align: left;
  background: #f0f4ff;
  border: 1px solid #c5d6f0;
  border-radius: 6px;
  padding: 14px 22px;
  margin: 14px 0;
}
.kac-creds-row { display: flex; gap: 14px; justify-content: space-between; margin: 4px 0; font-size: 15px; }
.kac-creds-row span { color: #555; }
.kac-note { color: #777; font-size: 13px; }
.kac-success-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* просмотр программы */
.kac-program-view {
  max-width: 100%;
  overflow: hidden;
}
.kac-program-view .kac-pv-actions { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.kac-pv-title { margin: 0; color: #2c4a77; font-size: 20px; }
.kac-pv-title a { color: inherit; text-decoration: none; }
.kac-pv-title a:hover { text-decoration: underline; }
.kac-pv-title,
.kac-pv-title a,
.kac-pv-info,
.kac-pv-line,
.kac-pv-comment,
.kac-day-name {
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.kac-pv-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.kac-pv-title-row .kac-pv-title { flex: 1 1 auto; min-width: 0; }
.kac-pv-title-row .kac-share { flex: 0 0 auto; }
.kac-share {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  line-height: 1;
  border: 1px solid #c5c9dd;
  background: #f5f6fb;
  color: #2c4a77;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kac-share:hover { background: #e8ecf7; }
.kac-share.copied { background: #e2f4e8; border-color: #7fbf8f; color: #1e6e33; }
.kac-pv-info { margin-bottom: 18px; font-size: 14px; }
.kac-pv-line { margin: 2px 0; }
.kac-day-block { margin-bottom: 18px; }
.kac-day-name {
  margin: 0 0 8px;
  font-size: 16px;
  color: #2c4a77;
  border-bottom: 1px solid #e0e0ea;
  padding-bottom: 6px;
}
.kac-table { width: 100%; border-collapse: collapse; }
.kac-table th, .kac-table td { border: 1px solid #ccc; padding: 7px 10px; font-size: 14px; text-align: left; }
.kac-table th { background: #eef1f8; }
.kac-table th,
.kac-table td {
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.kac-program-view .kac-table { table-layout: fixed; }
.kac-program-view .kac-table th:nth-child(2),
.kac-program-view .kac-table td:nth-child(2) { width: auto; }
.kac-t-num { width: 40px; text-align: center !important; }
.kac-t-c { width: 110px; text-align: center !important; }
.kac-pv-comment { margin-top: 10px; font-size: 14px; }

/* список программ */
.kac-pl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.kac-pl-title { color: #2c4a77; margin: 0; }
.kac-btn-create { white-space: nowrap; }
.kac-pl-empty { font-size: 15px; }
.kac-pl-table td:first-child { text-align: center; }
.kac-pl-table tbody tr:nth-child(odd) { background: #f7f9fc; }
.kac-pl-table a { color: #2c4a77; }
.kac-pl-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kac-pl-table th:nth-child(1),
.kac-pl-table td:nth-child(1) { width: 40px; }
.kac-pl-table th:nth-child(2),
.kac-pl-table td:nth-child(2) { width: 18%; }
.kac-pl-table th:nth-child(3),
.kac-pl-table td:nth-child(3) { width: 14%; }
.kac-pl-table th:nth-child(4),
.kac-pl-table td:nth-child(4) { width: auto; }
.kac-pl-table th:nth-child(5),
.kac-pl-table td:nth-child(5) { width: 110px; }
.kac-t-rating { text-align: center !important; }
.kac-t-rating .kac-stars-wrap { display: inline-flex; align-items: center; gap: 0; cursor: default; }
.kac-t-rating .kac-rating-info { display: block; text-align: center; margin-top: 2px; }
.kac-stars-wrap { display: inline-flex; align-items: center; gap: 0; cursor: default; }
.kac-stars-wrap .kac-star { color: #ddd; font-size: 16px; cursor: pointer; transition: color .15s, transform .15s; user-select: none; }
.kac-stars-wrap .kac-star.filled,
.kac-stars-wrap .kac-star.kac-star-hover { color: #e6a700; transform: scale(1.15); }
.kac-stars-wrap .kac-star.half { color: #e6a700; }
.kac-stars-wrap .kac-star:hover { transform: scale(1.25); }
.kac-stars { color: #e6a700; font-size: 13px; letter-spacing: 1px; }
.kac-stars-none { color: #999; }
.kac-rating-num { color: #2c4a77; font-weight: 600; }
.kac-rating-votes { color: #777; font-size: 12px; }
.kac-rating-text { color: #888; font-size: 12px; margin-left: 4px; }
.kac-pv-rating .kac-stars-wrap { cursor: default; }
.kac-pv-rating .kac-stars-wrap .kac-star { font-size: 22px; }
.kac-pv-rating .kac-rating-num { font-size: 15px; }
.kac-pl-table th,
.kac-pl-table td {
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.kac-pl-table td a { word-break: break-all; }

.kac-edit-box {
  margin-top: 22px;
  border: 1px solid #c5d6f0;
  border-radius: 6px;
  padding: 16px;
  background: #f7faff;
  max-width: 460px;
}
.kac-edit-box h4 { margin: 0 0 12px; color: #2c4a77; }
.kac-fields-inline { margin-bottom: 10px; }
.kac-edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* пагинация списка программ — строго в одну линию */
.kac-pagination { margin-top: 18px; text-align: center; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.kac-pagination ul { list-style: none; margin: 0; padding: 0 0 4px 0; display: inline-flex; flex-wrap: nowrap; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.kac-pagination li { margin: 0; }
.kac-pagination a,
.kac-pagination span {
  display: inline-block;
  min-width: 36px;
  padding: 7px 10px;
  border: 1px solid #c5d6f0;
  border-radius: 4px;
  background: #fff;
  color: #2c4a77;
  text-decoration: none;
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
}
.kac-pagination a:hover { background: #f0f4ff; border-color: #2c4a77; }
.kac-pagination .current {
  background: #2c4a77 !important;
  color: #fff !important;
  border-color: #2c4a77 !important;
}
.kac-pagination .dots { border: none; background: none; min-width: auto; padding: 7px 4px; }
.kac-pagination .prev,
.kac-pagination .next { padding-left: 12px; padding-right: 12px; }
.kac-pagination-info { margin-top: 10px; font-size: 13px; color: #777; text-align: center; }

@media (max-width: 600px) {
  .kac-ex-head { grid-template-columns: 1fr 1fr; }
  .kac-ex-row { grid-template-columns: 1fr 1fr; }
  .kac-ex-row .kac-ex-remove { width: 100%; }
  .kac-field { flex-basis: 100%; }

  /* визард питания: поиск + крестик в одной строке */
  #kac-n-form .kac-ex-head { display: none; }
  #kac-n-form .kac-ex-row { grid-template-columns: 1fr 34px; }
  #kac-n-form .kac-ex-row .kac-n-search { grid-column: 1; grid-row: 1; }
  #kac-n-form .kac-ex-row .kac-ex-remove { grid-column: 2; grid-row: 1; width: 34px; }
  #kac-n-form .kac-ex-row .kac-n-note-input { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Личный кабинет, авторизация, регистрация ---------- */

.kac-register, .kac-login-form, .kac-lost-password-form {
  max-width: 400px;
  margin: 0 auto;
}
.kac-register h3, .kac-lost-password-form h3 {
  color: #2c4a77;
  margin: 0 0 14px;
}
.kac-register-logged, .kac-lost-password-logged {
  text-align: center;
  padding: 20px;
}

.kac-login-logged {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kac-greeting {
  font-size: 14px;
}

.kac-cabinet {
  max-width: 800px;
  margin: 0 auto;
}
.kac-cabinet h3 {
  color: #2c4a77;
  margin: 0 0 18px;
}
.kac-cabinet-empty {
  text-align: center;
  padding: 30px 0;
}
.kac-cabinet-empty p {
  margin-bottom: 16px;
}
.kac-cabinet-list {
  margin-bottom: 20px;
}
.kac-cabinet-item {
  border: 1px solid #ccd;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #fafafd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.kac-cabinet-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kac-cabinet-item-name {
  font-size: 16px;
  color: #2c4a77;
  text-decoration: none;
  font-weight: 600;
}
.kac-cabinet-item-name:hover {
  text-decoration: underline;
}
.kac-cabinet-item-type {
  font-size: 13px;
  color: #777;
  background: #eef1f8;
  padding: 2px 8px;
  border-radius: 10px;
}
.kac-cabinet-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kac-btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
}
.kac-cabinet-create {
  text-align: center;
  margin-top: 20px;
}
.kac-delete-confirm {
  text-align: center;
  padding: 20px;
  background: #fdecec;
  border: 1px solid #d88;
  border-radius: 6px;
}
.kac-delete-confirm p {
  margin-bottom: 14px;
  color: #a22;
  font-size: 15px;
}
.kac-cabinet-login {
  text-align: center;
  padding: 30px;
  background: #f0f4ff;
  border-radius: 6px;
}
.kac-cabinet-login p {
  font-size: 15px;
}

.kac-login-links, .kac-reg-login-link, .kac-back-login {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}
.kac-login-links a, .kac-reg-login-link a, .kac-back-login a {
  color: #2c4a77;
  text-decoration: none;
}
.kac-login-links a:hover, .kac-reg-login-link a:hover, .kac-back-login a:hover {
  text-decoration: underline;
}