  * { box-sizing: border-box; }
  #pionflo-app-root {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f7f3f4;
    color: #1f1422;
  }
  :root {
    --accent: #be152d;
    --accent-soft: #d94b83;
    --border: #ecd2d8;
    --muted: #6b5b66;
    --surface: #ffffff;
  }
  .wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
  h1, h2, h3, h4 { font-family: Georgia, serif; margin: 0 0 8px; color: var(--accent); }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  h3 { font-size: 16px; }
  p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
  }

  input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    outline: none;
    font-family: inherit;
  }
  input:focus, select:focus { border-color: var(--accent-soft); }
  input:disabled { background: #f6eef2; color: var(--muted); cursor: not-allowed; }
  label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

  button {
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: #a01a35; }
  .btn-secondary { background: #f6eef2; color: var(--accent); }
  .btn-secondary:hover { background: #ecd2d8; }
  button:disabled { opacity: .5; cursor: not-allowed; }

  .field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 6px; }
  .field-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }

  .channel-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
  .channel-block { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fdf9fa; }
  .channel-block h4 { margin: 0 0 10px; color: var(--accent); font-size: 14px; }
  .channel-block .field-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .channel-computed { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--muted); }
  .channel-computed b { color: var(--accent); font-size: 13px; }
  .channel-block--total { margin-top: 12px; background: #fdf3f8; border-color: var(--accent-soft); }
  .channel-block--total .channel-computed { border-top: none; padding-top: 0; margin-top: 4px; }
  .channel-block--total b { font-size: 15px; }
  .field-check input { width: auto; }
  .field-check label { margin: 0; }

  details.section { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
  details.section summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--accent); font-family: Georgia, serif; list-style: none; background: #fdf3f8; }
  details.section summary::-webkit-details-marker { display: none; }
  details.section .section-body { padding: 16px; }

  .toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
  .toolbar > div { flex: 0 0 auto; }

  .tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
  .tab-btn { background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
  .tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

  table.summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  table.summary-table th, table.summary-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
  table.summary-table th { color: var(--muted); font-weight: 600; }
  table.summary-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  table.summary-table tr.total td { font-weight: 700; color: var(--accent); border-top: 2px solid var(--border); }
  .bar-cell { position: relative; }
  .bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #fdf3f8; z-index: 0; }
  .bar-cell > span { position: relative; z-index: 1; }

  .stat-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
  .stat-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
  .stat-hero-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
  .stat-hero-value { font-family: Georgia, serif; font-size: 24px; font-weight: 700; color: var(--accent); margin: 6px 0 4px; }
  .stat-hero-change { font-size: 12px; }

  .stat-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .stat-mini { background: #fdf9fa; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
  .stat-mini-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
  .stat-mini-value { font-size: 16px; font-weight: 700; color: #1f1422; }

  .summary-days-count { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

  .achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .achv-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; background: #fdf9fa; opacity: .55; }
  .achv-card.earned { background: #fff8e6; border-color: #f0d789; opacity: 1; }
  .achv-icon { font-size: 28px; }
  .achv-label { font-size: 12px; margin: 8px 0 6px; color: var(--muted); line-height: 1.4; }
  .achv-progress { font-size: 11px; font-weight: 700; color: var(--accent); }
  .achv-category-title { font-family: Georgia, serif; font-size: 14px; color: var(--accent); margin: 16px 0 10px; }
  .achv-category-title:first-of-type { margin-top: 0; }

  .goal-bar-wrap { background: #f6eef2; border-radius: 999px; height: 16px; overflow: hidden; }
  .goal-bar-fill { background: var(--accent); height: 100%; transition: width .3s; }

  #login-screen { max-width: 380px; margin: 80px auto; }

  .hero-banner {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 220px;
    margin-bottom: 20px;
    background-image: url('https://sun9-29.vkuserphoto.ru/s/v1/ig2/CgdcHDoeU0L_ZYu4_YwUeL3sg-Yn8NYTX3Oqyov9JiZRgUEMAmzaR5JTAyDetEiVQxg514jNynTVYhl2mFEtccvR.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,1448x1086&from=bu&u=aVnRevpL5SlhoKa-3X7QY4Fav3c1h3ssuKLIah55PRY&cs=1448x0');
    background-size: cover;
    background-position: center 35%;
    box-shadow: 0 10px 30px -12px rgba(31,20,34,.45);
  }
  .hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,8,14,.82) 0%, rgba(20,8,14,.35) 45%, rgba(20,8,14,0) 75%);
  }
  .hero-banner-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px 24px;
    z-index: 1;
  }
  .hero-banner-title {
    font-family: Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    letter-spacing: .5px;
    text-shadow: 0 2px 10px rgba(0,0,0,.5);
  }
  .hero-banner-subtitle {
    font-size: 14px;
    color: #f7dbe4;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0,0,0,.5);
  }
  @media (max-width: 640px) {
    .hero-banner { height: 160px; border-radius: 16px; }
    .hero-banner-title { font-size: 24px; }
  }
  #app-screen { display: none; }
  .top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
  .user-badge { font-size: 13px; color: var(--muted); }
  .status-msg { font-size: 13px; margin-top: 8px; min-height: 16px; }
  .status-msg.error { color: #c0392b; }
  .status-msg.success { color: #2e7d32; }

  .city-pill { display: inline-block; background: #f6eef2; color: var(--accent); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

  /* Прокручиваемый контейнер для таблиц, чтобы они не «ломались» на узких экранах */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table.summary-table { width: 100%; }
  .table-scroll table.summary-table th,
  .table-scroll table.summary-table td { white-space: nowrap; }

  @media (max-width: 640px) {
    .wrap { padding: 14px 10px 40px; }
    .card { padding: 14px; border-radius: 12px; margin-bottom: 14px; }
    h1 { font-size: 21px; }
    h2 { font-size: 17px; }
    h3 { font-size: 15px; }

    .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .toolbar > div { width: 100%; }
    .toolbar select, .toolbar input { width: 100%; }

    .tabs { gap: 6px; }
    .tab-btn { padding: 8px 12px; font-size: 13px; }

    button { padding: 10px 16px; font-size: 13px; }

    .table-scroll table.summary-table { min-width: 560px; font-size: 12.5px; }
    table.summary-table th, table.summary-table td { padding: 7px 8px; }

    .stat-hero-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-hero { padding: 12px; }
    .stat-hero-value { font-size: 19px; }

    .achv-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-mini-grid { grid-template-columns: repeat(2, 1fr); }

    .channel-blocks { grid-template-columns: 1fr; }
    .field-grid { grid-template-columns: 1fr; }

    .hero-banner-content { padding: 14px 16px; }
    .hero-banner-subtitle { font-size: 12.5px; }

    .top-bar { gap: 6px; }
    .top-bar h1 { font-size: 17px; }
  }
