:root {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Roboto", "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: #0f1115 url('./backgroud.webp') center 60px no-repeat fixed;
  background-size: 1000px; /* ширина x высота */

  color: #e6edf3;
}
#app {
  min-height: 100vh;
}
.content-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: #141821;
  border-bottom: 1px solid #1f2633;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.app-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.app-subtitle {
  margin: 0;
  font-size: 12px;
  color: #9aa7b8;
}
@media (max-width: 600px) {
  .app-subtitle {
    display: none;
  }
}
.profile-icon {
  border: 1px solid #384154;
  color: #ffffff;
}
.dashboard-hero {
  margin-bottom: 24px;
}
.dashboard-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
}
.dashboard-subtitle {
  font-size: 15px;
  color: #c0cad6;
  line-height: 1.6;
}
.dashboard-section {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}
.landing {
  background: linear-gradient(135deg, rgba(36, 44, 62, 0.7), rgba(20, 24, 33, 0.9));
  border: 1px solid #222a38;
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 12px;
  max-width: 760px;
}
.landing-hero {
  padding: 32px;
  gap: 20px;
}
.landing-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}
.landing-hero-left {
  display: grid;
  gap: 12px;
}
.landing-hero-info {
  display: grid;
  gap: 12px;
}
.landing-info-block {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px dashed #273144;
}
.landing-info-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.landing-info-block h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}
.landing-info-block .landing-body {
  white-space: pre-line;
}
.landing-full {
  max-width: 100%;
}
.landing-info {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}
.landing-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.landing-panel {
  background: rgba(18, 22, 30, 0.75);
  border: 1px solid #273144;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.landing-panel .landing-body {
  white-space: pre-line;
}
@media (max-width: 900px) {
  .landing-panels {
    grid-template-columns: 1fr;
  }
}
.landing-info h3 {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}
.landing-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  white-space: pre-line;
}
.landing-subtitle {
  margin: 0;
  font-size: 16px;
  color: #c0cad6;
  line-height: 1.6;
}
.landing-body {
  margin: 0;
  font-size: 14px;
  color: #9aa7b8;
  line-height: 1.6;
}
.landing-actions {
  margin-top: 8px;
}
.landing-body-cta {
  margin: 0;
  max-width: 520px;
  color: #c0cad6;
}
@media (max-width: 1000px) {
  .landing-hero-main {
    grid-template-columns: 1fr;
  }
}
.profile-card {
  margin-top: 8px;
}
.upload-drop {
  border: 2px dashed #2b3240;
  border-radius: 14px;
  padding: 28px;
  background: #141821;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 100%;
}
.upload-drop.dragging {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.2);
}
.upload-hero {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 16px;
  background: radial-gradient(circle at top, rgba(122, 162, 255, 0.2), transparent 60%),
    linear-gradient(135deg, rgba(34, 41, 56, 0.9), rgba(18, 22, 30, 0.95));
  border: 1px solid #273144;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.upload-hero-compact {
  min-height: 110px;
  padding: 10px 10px;
}
.upload-hero input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-hero-inner {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}
.upload-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(122, 162, 255, 0.2);
  display: grid;
  place-items: center;
  color: #cfe0ff;
}
.upload-hero-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.upload-hero-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  padding: 0 16px;
}
.upload-hero-subtitle {
  font-size: 13px;
  color: #9aa7b8;
  padding: 0 16px;
}
.upload-hero-note {
  margin-top: 4px;
  font-size: 12px;
  color: #8b98ab;
}
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.analysis-result {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.file-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.file-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-sub {
  color: #9aa7b8;
  font-size: 12px;
}
.result {
  white-space: pre-wrap;
  background: #0f141f;
  border: 1px solid #273144;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
}
.edited-preview {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.edited-image {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #2b3240;
}
.usage-list {
  display: grid;
  gap: 6px;
}
.usage-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.6fr;
  gap: 8px;
  font-size: 12px;
  color: #c0cad6;
}
.file-count {
  color: #9aa7b8;
  font-size: 13px;
}
.files-row {
  margin-top: 20px;
}
.footer-note {
  margin-top: 28px;
  color: #9aa7b8;
  font-size: 13px;
}
.muted {
  color: #9aa7b8;
  font-size: 12px;
}
.balance-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
}
.balance-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.balance-label {
  color: #9aa7b8;
  font-size: 13px;
}
.billing-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.profile-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .billing-panels {
    grid-template-columns: 1fr;
  }
  .profile-goals-grid {
    grid-template-columns: 1fr;
  }
}

.promo-input .n-input__border,
.promo-input .n-base-selection__border,
.promo-input .n-input__state-border {
  border-color: #7aa2ff !important;
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.35) !important;
}
.goal-recommendations {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.weight-log-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}
.weight-table {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.weight-pagination {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.weight-goals-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.weight-panel {
  display: grid;
  gap: 16px;
}
.weight-goals-grid .goals-panel {
  margin-top: 0;
}
.weight-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px dashed #273144;
}
.weight-header {
  font-size: 12px;
  color: #9aa7b8;
  text-transform: uppercase;
}
.weight-chart {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.weight-chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  gap: 8px;
  align-items: center;
}
.weight-chart-label {
  font-size: 12px;
  color: #9aa7b8;
}
.weight-chart-value {
  font-size: 12px;
  color: #c0cad6;
  text-align: right;
}
.food-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.food-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
.food-name {
  grid-column: 1 / -1;
}
.food-add-row {
  grid-column: 1 / -1;
}
.food-upload-actions {
  margin-top: 10px;
}
@media (max-width: 900px) {
  .food-form {
    grid-template-columns: 1fr;
  }
}
.food-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.food-manual {
  order: 1;
}
.food-upload {
  order: 2;
}
@media (max-width: 900px) {
  .food-grid {
    grid-template-columns: 1fr;
  }
  .food-manual {
    order: 1;
  }
  .food-upload {
    order: 2;
  }
}
}
.food-table {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.food-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px dashed #273144;
}
.food-header {
  font-size: 12px;
  color: #9aa7b8;
  text-transform: uppercase;
}
.food-chart {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.food-chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  gap: 8px;
  align-items: center;
}
.food-chart-label {
  font-size: 12px;
  color: #9aa7b8;
}
.food-chart-value {
  font-size: 12px;
  color: #c0cad6;
  text-align: right;
}

@media (max-width: 720px) {
  .food-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .food-header {
    display: none;
  }
  .weight-goals-grid {
    grid-template-columns: 1fr;
  }
  .weight-goals-grid .goals-panel {
    order: -1;
  }
  .food-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid #273144;
    border-radius: 14px;
    background: #0f141f;
  }
  .food-row > div {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .food-row > div::before {
    content: attr(data-label);
    min-width: 96px;
    color: #9aa7b8;
    font-size: 12px;
  }
  .food-row > div > * {
    flex: 1;
  }
  .food-row > div:last-child {
    justify-content: flex-end;
  }
  .food-row > div:last-child::before {
    content: '';
  }
  .food-row > div:last-child > * {
    flex: 0 0 auto;
  }
}

/* Force dark theme for all UI blocks */
.n-card,
.n-modal,
.n-dialog,
.n-drawer,
.n-popover,
.n-dropdown-menu,
.n-menu,
.n-alert {
  background-color: #141821 !important;
  color: #e6edf3 !important;
  border-color: #273144 !important;
}
.n-card__header,
.n-card__content,
.n-card__footer,
.n-modal__content,
.n-dialog__content,
.n-drawer__content,
.n-alert__content {
  background-color: #141821 !important;
  color: #e6edf3 !important;
}
.n-input,
.n-input__input,
.n-input__textarea,
.n-input-number,
.n-base-selection,
.n-base-selection-label,
.n-base-selection-input,
.n-select,
.n-select__menu {
  background-color: #0f141f !important;
  color: #e6edf3 !important;
  border-color: #273144 !important;
}
.n-button {
  border-color: #273144 !important;
}
.n-tag {
  background-color: #1b2230 !important;
  color: #e6edf3 !important;
}
.n-empty,
.n-empty__description {
  color: #9aa7b8 !important;
}

.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(6px);
}

.page-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 26px;
  border-radius: 16px;
  border: 1px solid #273144;
  background: #141821;
  color: #e6edf3;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.page-overlay-text {
  font-size: 14px;
  color: #e6edf3;
  max-width: 320px;
}
