*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

body {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e5e7eb;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 24px;
}

.app-header {
  text-align: center;
  margin-bottom: 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: #9ca3af;
}

.card {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.8);
}

.card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #9ca3af;
}

/* Общие поля (для инпутов) */

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.field-group label {
  font-size: 12px;
  margin-bottom: 4px;
  color: #9ca3af;
}

.field-group select,
.field-group input {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.6);
  color: #e5e7eb;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}

.field-group select:focus,
.field-group input:focus {
  border-color: #3b82f6;
}

/* Список счётчиков */

.meters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.meter-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meter-name {
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
}

.meter-prev {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.meter-prev span.value {
  color: #e5e7eb;
  font-weight: 500;
}

.meter-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meter-input-wrapper label {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 2px;
}

.meter-input {
  width: 120px;
}

.meter-input input {
  width: 100%;
  text-align: right;
}

/* disabled input (Цветы) */

.meter-input input:disabled {
  opacity: 0.6;
  border-style: dashed;
  cursor: default;
}

/* Кнопка + статус */

.actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #f9fafb;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.55);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, opacity 0.08s ease-out;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.45);
  opacity: 0.9;
}

.status-message {
  min-height: 16px;
  font-size: 12px;
  text-align: center;
}

.status-message.success {
  color: #4ade80;
}

.status-message.error {
  color: #f97373;
}

/* Wheel picker */

.wheel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wheel-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wheel-label {
  font-size: 12px;
  color: #9ca3af;
}

.wheel {
  position: relative;
  height: 132px; /* 3 строки по 44px */
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
  touch-action: pan-y;
}

/* затемнения сверху/снизу */

.wheel::before,
.wheel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 44px;
  pointer-events: none;
  z-index: 2;
}

.wheel::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0));
}

.wheel::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0));
}

/* центральная "линия выбора" */

.wheel-center {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 44px;        /* центр = вторая строка */
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(37, 99, 235, 0.12);
  z-index: 1;
  pointer-events: none;
}

/* контейнер элементов, прокручиваемый */

.wheel-items {
  position: absolute;
  inset: 0;
  padding-top: 44px;
  padding-bottom: 44px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.wheel-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #9ca3af;
  user-select: none;
  scroll-snap-align: center;
}

.wheel-item.is-selected {
  color: #e5e7eb;
  font-weight: 600;
}

.period-preview {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #e5e7eb;
  opacity: 0.9;
}
