:root {
      --bg-base: #faf7f7;
      --bg-surface: #ffffff;
      --bg-surface-elevated: rgba(255, 255, 255, 0.96);
      --accent-primary: #c75d74;
      --accent-primary-hover: #b44f65;
      --accent-soft: #fcf1f3;
      --accent-gradient: linear-gradient(135deg, #c75d74 0%, #db7f93 100%);
      --accent-pink: var(--accent-primary);
      --accent-pink-hover: var(--accent-primary-hover);
      --accent-pink-soft: var(--accent-soft);
      --accent-purple: var(--accent-primary);
      --accent-purple-soft: var(--accent-soft);
      --accent-purple-gradient: var(--accent-gradient);
      --text-main: #201e23;
      --text-secondary: #65606c;
      --text-muted: #9c95a3;
      --border-subtle: #eee8ea;
      --border-accent: rgba(199, 93, 116, 0.22);
      --status-success: #237852;
      --status-success-soft: #edf7f2;
      --status-danger: #b83d4f;
      --status-danger-soft: #fdf2f4;
      --success-green: var(--status-success);
      --success-soft: var(--status-success-soft);
      --warning-amber: #c26a3e;
      --warning-soft: #fdf6f0;
      --shadow-subtle: 0 2px 8px rgba(32, 30, 35, 0.03);
      --shadow-card: 0 6px 20px rgba(199, 93, 116, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
      --shadow-floating: 0 10px 26px rgba(199, 93, 116, 0.22);
      --radius-sm: 10px;
      --radius-md: 16px;
      --radius-lg: 22px;
      --radius-full: 9999px;
      --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --bg-base: #131215;
        --bg-surface: #1b191f;
        --bg-surface-elevated: rgba(27, 25, 31, 0.96);
        --accent-primary: #db768c;
        --accent-primary-hover: #e88fa2;
        --accent-soft: rgba(219, 118, 140, 0.14);
        --accent-gradient: linear-gradient(135deg, #db768c 0%, #ea95a7 100%);
        --text-main: #f5f3f6;
        --text-secondary: #aaa4b2;
        --text-muted: #726c7a;
        --border-subtle: #292630;
        --border-accent: rgba(219, 118, 140, 0.3);
        --status-success: #34d399;
        --status-success-soft: rgba(52, 211, 153, 0.12);
        --status-danger: #f87171;
        --status-danger-soft: rgba(248, 113, 113, 0.12);
        --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.4);
      }
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    }

    :root {
      --tg-safe-top: 0px;
    }

    body {
      background: var(--bg-base);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      padding-bottom: 96px;
      -webkit-font-smoothing: antialiased;
    }

    .app-viewport {
      width: 100%;
      max-width: 480px;
      padding-top: max(
        env(safe-area-inset-top, 0px),
        var(--tg-content-safe-area-inset-top, 0px),
        var(--tg-safe-area-inset-top, 0px),
        var(--tg-safe-top, 0px),
        16px
      );
      padding-left: max(env(safe-area-inset-left, 0px), 14px);
      padding-right: max(env(safe-area-inset-right, 0px), 14px);
      padding-bottom: max(env(safe-area-inset-bottom, 0px), 96px);
      display: flex;
      flex-direction: column;
      gap: 16px;
      transition: padding-top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* RESPONSIVE DESKTOP & TABLET ADAPTATIONS */
    @media (min-width: 768px) {
      body {
        padding-bottom: 40px;
        background: #f4efef;
      }
      .app-viewport {
        max-width: 880px;
        padding-top: 32px;
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 48px;
      }
      .desktop-2col {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 20px;
        align-items: start;
      }
      .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px;
      }
      .footer-nav {
        max-width: 520px;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 24px !important;
        border-radius: var(--radius-full) !important;
        border: 1px solid var(--border-subtle) !important;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
      }
    }
    @media (min-width: 1024px) {
      .app-viewport {
        max-width: 980px;
      }
      .gallery-grid {
        grid-template-columns: repeat(4, 1fr) !important;
      }
    }

    /* HEADER */
    .top-bar {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .brand-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .brand-badge {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-logo {
      width: 44px;
      height: 44px;
      border-radius: var(--radius-md);
      background: var(--accent-gradient);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      box-shadow: 0 6px 16px rgba(255, 77, 121, 0.32);
    }

    .brand-title h1 {
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -0.3px;
      line-height: 1.2;
    }

    .brand-meta {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 2px;
    }

    .brand-meta .location-pill {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      color: var(--accent-pink);
      background: var(--accent-pink-soft);
      padding: 2px 7px;
      border-radius: var(--radius-full);
      font-weight: 700;
      line-height: 1;
      font-size: 11px;
    }

    .brand-meta .location-pill .loc-pin {
      font-size: 11px;
      line-height: 1;
      display: inline-block;
      transform: translateY(-0.5px);
    }

    .top-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .channel-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: var(--radius-full);
      background: var(--accent-pink-soft);
      color: var(--accent-pink);
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      border: 1px solid var(--border-accent);
    }

    .live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 8px #10b981;
      animation: pulseGreen 2s infinite ease-in-out;
    }

    @keyframes pulseGreen {
      0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
      70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
      100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
    }

    /* ROLE SWITCHER */
    .role-switcher-container {
      background: var(--bg-surface);
      border: 1.5px solid var(--border-subtle);
      border-radius: var(--radius-full);
      padding: 4px;
      display: flex;
      gap: 4px;
      position: relative;
      box-shadow: var(--shadow-subtle);
    }

    .role-btn {
      flex: 1;
      padding: 8px 10px;
      border-radius: var(--radius-full);
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: var(--transition);
      white-space: nowrap;
    }

    .role-btn.active {
      color: #ffffff;
      background: var(--accent-gradient);
      box-shadow: 0 4px 14px rgba(255, 77, 121, 0.32);
    }

    /* CARDS & CONTAINERS */
    .ui-card {
      background: var(--bg-surface);
      border-radius: var(--radius-lg);
      padding: 16px 15px;
      border: 1px solid var(--border-subtle);
      box-shadow: var(--shadow-card);
      position: relative;
    }

    .ui-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .ui-card-title {
      font-size: 15px;
      font-weight: 800;
      display: flex;
      align-items: center;
      gap: 7px;
      letter-spacing: -0.2px;
    }

    .ui-card-subtitle {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
    }

    /* BUTTONS */
    .btn-primary {
      width: 100%;
      padding: 14px;
      border-radius: var(--radius-md);
      background: var(--accent-gradient);
      color: #ffffff;
      border: none;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-shadow: var(--shadow-floating);
      transition: var(--transition);
      margin-top: 14px;
    }

    .btn-primary:active { transform: scale(0.98); }

    .btn-secondary {
      width: 100%;
      padding: 11px;
      border-radius: var(--radius-md);
      background: var(--bg-base);
      color: var(--text-main);
      border: 1.5px solid var(--border-subtle);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: var(--transition);
    }

    .btn-secondary:active { transform: scale(0.98); }

    .btn-outline {
      padding: 7px 12px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-accent);
      background: var(--accent-pink-soft);
      color: var(--accent-pink);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      transition: var(--transition);
    }

    /* DATE PICKER & MONTH CALENDAR */
    .calendar-month-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 6px 10px;
    }

    .month-nav-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 1px solid var(--border-subtle);
      background: var(--bg-base);
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-weight: 700;
    }

    .month-title {
      font-size: 14px;
      font-weight: 800;
      color: var(--text-main);
    }

    .calendar-toggle-link {
      font-size: 11px;
      color: var(--accent-pink);
      font-weight: 700;
      cursor: pointer;
      text-decoration: underline;
    }

    .date-scroll-strip {
      display: flex;
      gap: 7px;
      overflow-x: auto;
      padding: 2px 2px 8px;
      scrollbar-width: none;
    }
    .date-scroll-strip::-webkit-scrollbar { display: none; }

    .date-item {
      flex: 0 0 auto;
      width: 54px;
      padding: 9px 0;
      border-radius: var(--radius-md);
      background: var(--bg-base);
      border: 1.5px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      cursor: pointer;
      transition: var(--transition);
      position: relative;
    }

    .date-item .weekday {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
    }

    .date-item .day-number {
      font-size: 16px;
      font-weight: 800;
      color: var(--text-main);
    }

    .date-item .slot-dot {
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--accent-pink);
      margin-top: 1px;
    }

    .date-item.active {
      background: var(--accent-gradient);
      border-color: transparent;
      box-shadow: 0 5px 14px rgba(255, 77, 121, 0.3);
    }

    .date-item.active .weekday,
    .date-item.active .day-number { color: #ffffff; }
    .date-item.active .slot-dot { background: #ffffff; }

    .month-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px;
      margin-top: 8px;
      text-align: center;
    }

    .month-grid-header {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      padding-bottom: 4px;
      text-transform: uppercase;
    }

    .month-grid-day {
      aspect-ratio: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-sm);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      position: relative;
      transition: var(--transition);
    }

    .month-grid-day.has-slots::after {
      content: '';
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--accent-pink);
      position: absolute;
      bottom: 2px;
    }

    .month-grid-day.selected {
      background: var(--accent-gradient);
      color: #ffffff;
    }
    .month-grid-day.selected::after { background: #ffffff; }
    .month-grid-day.disabled { opacity: 0.25; cursor: not-allowed; }

    /* TIME SLOTS */
    .time-period-group { margin-top: 10px; }
    .time-period-title {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 6px;
    }

    .time-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .time-chip {
      padding: 10px 6px;
      border-radius: var(--radius-sm);
      background: var(--bg-base);
      border: 1.5px solid var(--border-subtle);
      color: var(--text-main);
      font-size: 13px;
      font-weight: 700;
      text-align: center;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      transition: var(--transition);
    }

    .time-chip .chip-label {
      font-size: 9px;
      font-weight: 600;
      color: var(--accent-pink);
      opacity: 0.85;
    }

    .time-chip.selected {
      background: var(--accent-pink-soft);
      border-color: var(--accent-pink);
      color: var(--accent-pink);
    }
    .time-chip.selected .chip-label { color: var(--accent-pink); }

    /* SERVICES */
    .service-selection-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .service-card {
      padding: 12px 14px;
      border-radius: var(--radius-md);
      background: var(--bg-base);
      border: 1.5px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      transition: var(--transition);
    }

    .service-card.selected {
      border-color: var(--accent-pink);
      background: var(--accent-pink-soft);
    }
    .service-card.selected .service-name { color: var(--accent-pink); }

    .service-name { font-size: 13px; font-weight: 700; }
    .service-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
    .service-price-tag { font-size: 14px; font-weight: 800; color: var(--accent-pink); white-space: nowrap; flex-shrink: 0; }

    /* ADD-ONS */
    .addons-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
      margin-top: 8px;
    }

    .addon-chip {
      padding: 9px 10px;
      border-radius: var(--radius-sm);
      background: var(--bg-base);
      border: 1.5px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      transition: var(--transition);
      gap: 4px;
    }

    .addon-chip.selected {
      border-color: var(--accent-primary);
      background: var(--accent-soft);
    }

    .addon-name { font-size: 11px; font-weight: 700; }
    .addon-price { font-size: 11px; font-weight: 800; color: var(--accent-primary); white-space: nowrap; flex-shrink: 0; }

    /* SUMMARY CALC */
    .summary-card {
      background: var(--accent-soft);
      border: 1.5px solid var(--border-accent);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 10px;
    }

    .summary-details { font-size: 12px; color: var(--text-secondary); }
    .summary-total { font-size: 18px; font-weight: 800; color: var(--accent-primary); text-align: right; white-space: nowrap; flex-shrink: 0; }

    /* FORM INPUTS & TELEGRAM BINDING */
    .field-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 5px;
      display: block;
    }

    .text-input, .textarea-input, .select-input {
      width: 100%;
      padding: 11px 13px;
      border-radius: var(--radius-md);
      border: 1.5px solid var(--border-subtle);
      background: var(--bg-base);
      color: var(--text-main);
      font-size: 13px;
      outline: none;
      transition: var(--transition);
    }

    .text-input:focus, .textarea-input:focus, .select-input:focus {
      border-color: var(--accent-primary);
      background: var(--bg-surface);
    }

    /* TELEGRAM BADGE CHIP */
    .client-tg-badge {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 12px;
      border-radius: var(--radius-md);
      background: var(--bg-base);
      border: 1.5px solid var(--border-subtle);
      margin-top: 4px;
    }

    .tg-avatar {
      font-size: 20px;
      margin-right: 8px;
    }

    .tg-info-col {
      flex: 1;
    }

    .tg-label-sub {
      font-size: 10px;
      color: var(--text-muted);
      font-weight: 700;
    }

    .tg-username-val {
      font-size: 13px;
      font-weight: 800;
      color: var(--text-main);
    }

    .tg-status-tag {
      font-size: 10px;
      font-weight: 700;
      color: var(--status-success);
      background: var(--status-success-soft);
      padding: 2px 7px;
      border-radius: var(--radius-full);
    }

    .tg-note {
      font-size: 10px;
      color: var(--text-muted);
      margin-top: 4px;
      line-height: 1.35;
    }

    /* REFERENCE PHOTO UPLOAD (CLIENT) */
    .ref-upload-box {
      border: 1.5px dashed var(--border-accent);
      background: var(--accent-soft);
      border-radius: var(--radius-md);
      padding: 12px;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
      margin-top: 4px;
    }

    .ref-upload-box:hover {
      border-color: var(--accent-primary);
    }

    .ref-preview-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .ref-preview-wrap img {
      width: 52px;
      height: 52px;
      object-fit: cover;
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
    }

    .btn-ref-remove {
      padding: 4px 8px;
      border-radius: var(--radius-full);
      border: none;
      background: rgba(239, 68, 68, 0.1);
      color: #ef4444;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
    }

    /* ACTIVE BOOKING CARD (CLIENT) */
    .active-booking-card {
      background: linear-gradient(135deg, #2a2630 0%, #3d3544 100%);
      border-radius: var(--radius-lg);
      padding: 18px 16px;
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 10px 24px rgba(42, 38, 48, 0.22);
      position: relative;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      background: rgba(255, 255, 255, 0.22);
      border-radius: var(--radius-full);
      font-size: 11px;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .booking-actions-row {
      display: flex;
      gap: 8px;
      margin-top: 14px;
    }

    .btn-booking-action {
      flex: 1;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      border: none;
      background: rgba(255, 255, 255, 0.22);
      color: white;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: var(--transition);
    }

    /* PORTFOLIO GALLERY */
    .filter-pills-strip {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      scrollbar-width: none;
      padding-bottom: 10px;
    }
    .filter-pills-strip::-webkit-scrollbar { display: none; }

    .filter-pill {
      flex: 0 0 auto;
      padding: 6px 12px;
      border-radius: var(--radius-full);
      background: var(--bg-base);
      border: 1px solid var(--border-subtle);
      font-size: 11px;
      font-weight: 700;
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--transition);
    }

    .filter-pill.active {
      background: var(--accent-gradient);
      color: white;
      border-color: transparent;
      box-shadow: 0 3px 10px rgba(255, 77, 121, 0.25);
    }

    .gallery-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .gallery-item-card {
      border-radius: var(--radius-md);
      overflow: hidden;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      box-shadow: var(--shadow-subtle);
      display: flex;
      flex-direction: column;
      transition: var(--transition);
    }

    .gallery-img-wrap {
      width: 100%;
      height: 130px;
      position: relative;
      background: #eee;
    }

    .gallery-img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .gallery-tag {
      position: absolute;
      top: 6px;
      left: 6px;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(6px);
      color: white;
      font-size: 9px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: var(--radius-full);
    }

    .gallery-info {
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .gallery-title { font-size: 11px; font-weight: 700; }
    .gallery-price { font-size: 12px; font-weight: 800; color: var(--accent-pink); }

    .btn-want-this {
      margin-top: 4px;
      padding: 6px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-accent);
      background: var(--accent-pink-soft);
      color: var(--accent-pink);
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      text-align: center;
    }

    /* MASTER MODE ELEMENTS */
    .slot-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 11px 12px;
      border-radius: var(--radius-md);
      background: var(--bg-base);
      border: 1px solid var(--border-subtle);
      margin-bottom: 8px;
    }

    .slot-badge-time {
      font-size: 13px;
      font-weight: 800;
      background: var(--bg-surface);
      padding: 4px 8px;
      border-radius: 6px;
      border: 1px solid var(--border-subtle);
    }

    .tag-free {
      font-size: 10px;
      font-weight: 700;
      color: var(--success-green);
      background: var(--success-soft);
      padding: 3px 8px;
      border-radius: var(--radius-full);
    }

    .tag-booked {
      font-size: 10px;
      font-weight: 700;
      color: var(--accent-pink);
      background: var(--accent-pink-soft);
      padding: 3px 8px;
      border-radius: var(--radius-full);
    }

    .btn-trash {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: none;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .btn-trash:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

    /* MULTI-PHOTO UPLOAD (CHANNEL TAB) */
    .master-photos-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
      gap: 6px;
      width: 100%;
      margin-top: 8px;
    }
    .master-photo-thumb-wrap {
      position: relative;
      width: 100%;
      padding-top: 100%;
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid var(--border-subtle);
    }
    .master-photo-thumb-wrap img {
      position: absolute;
      top: 0; left: 0;
      width: 100%; height: 100%;
      object-fit: cover;
    }
    .btn-photo-remove {
      position: absolute;
      top: 2px; right: 2px;
      width: 18px; height: 18px;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.7);
      color: white;
      border: none;
      font-size: 10px;
      font-weight: 800;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      z-index: 5;
    }
    .master-photo-thumb-wrap.is-cover {
      border: 2.5px solid #f59e0b !important;
      box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    }
    .cover-badge {
      position: absolute;
      bottom: 4px;
      left: 3px;
      right: 3px;
      background: rgba(0, 0, 0, 0.85);
      color: #fbbf24;
      font-size: 8px;
      font-weight: 800;
      padding: 2px 4px;
      border-radius: 4px;
      text-align: center;
      pointer-events: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      z-index: 3;
    }
    .make-cover-hint {
      position: absolute;
      bottom: 4px;
      left: 3px;
      right: 3px;
      background: rgba(0, 0, 0, 0.7);
      color: #ffffff;
      font-size: 7px;
      font-weight: 700;
      padding: 2px 3px;
      border-radius: 4px;
      text-align: center;
      opacity: 0;
      transition: opacity 0.2s;
      pointer-events: none;
      z-index: 3;
    }
    .master-photo-thumb-wrap:hover .make-cover-hint {
      opacity: 1;
    }
    .master-photo-add-tile {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      border: 1.5px dashed var(--border-accent);
      border-radius: 8px;
      cursor: pointer;
      background: var(--accent-soft);
      color: var(--accent-primary);
      font-size: 11px;
      font-weight: 700;
      min-height: 64px;
    }

    /* GROUPED SLOTS BY DATE */
    .slot-group-card {
      background: var(--bg-base);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      margin-bottom: 8px;
    }
    .slot-group-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      font-size: 13px;
      font-weight: 800;
    }
    .btn-day-off {
      padding: 3px 8px;
      border-radius: var(--radius-full);
      border: 1px solid rgba(239, 68, 68, 0.2);
      background: rgba(239, 68, 68, 0.08);
      color: #ef4444;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
    }
    .slot-chips-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .slot-chip-item {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 8px;
      border-radius: 8px;
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      font-size: 12px;
      font-weight: 700;
    }
    .slot-chip-item.booked {
      border-color: rgba(255, 77, 121, 0.3);
      background: var(--accent-pink-soft);
      color: var(--accent-pink);
    }
    .slot-chip-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 0 2px;
      font-size: 11px;
    }
    .slot-chip-btn:hover { color: var(--accent-primary); }

    /* MONTH BULK PLANNER */
    .month-planner-wrap {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 12px;
      margin-top: 10px;
    }
    .month-nav-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      font-weight: 800;
      font-size: 13px;
    }
    .month-calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 4px;
      text-align: center;
    }
    .cal-weekday {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      padding: 3px 0;
    }
    .cal-day-cell {
      padding: 7px 0;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      border: 1px solid transparent;
      background: var(--bg-base);
      transition: var(--transition);
    }
    .cal-day-cell.selected {
      background: var(--accent-gradient);
      color: white;
      box-shadow: 0 2px 8px rgba(255, 77, 121, 0.25);
    }
    .cal-day-cell.disabled {
      opacity: 0.25;
      cursor: not-allowed;
    }

    /* MASTER AI GENERATOR */
    .ai-generator-panel {
      background: var(--bg-surface);
      border: 1.5px solid var(--border-subtle);
      border-radius: var(--radius-lg);
      padding: 14px;
      margin-top: 10px;
    }

    .ai-sparkle-btn {
      width: 100%;
      padding: 11px;
      border-radius: var(--radius-md);
      background: var(--accent-gradient);
      color: white;
      border: none;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      margin-top: 10px;
      box-shadow: 0 4px 12px rgba(199, 93, 116, 0.22);
    }

    .ai-regenerate-btn {
      padding: 6px 12px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-accent);
      background: var(--accent-soft);
      color: var(--accent-primary);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 6px;
    }

    /* TELEGRAM POST PREVIEW */
    .telegram-post-mockup {
      background: #1c1a21;
      color: #ffffff;
      border-radius: var(--radius-md);
      padding: 12px;
      margin-top: 12px;
      border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tg-mockup-header {
      font-size: 11px;
      color: #9c95a3;
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
    }

    .tg-post-body {
      font-size: 12px;
      line-height: 1.45;
      color: #e5e0ea;
      white-space: pre-line;
    }

    .tg-inline-button {
      margin-top: 10px;
      background: var(--accent-soft);
      border: 1px solid var(--border-accent);
      color: var(--accent-primary);
      border-radius: 8px;
      padding: 8px;
      text-align: center;
      font-size: 11px;
      font-weight: 700;
    }

    /* BENTO STATS */
    .stats-bento {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 9px;
    }

    .bento-box {
      background: var(--bg-surface);
      border-radius: var(--radius-lg);
      padding: 14px;
      border: 1px solid var(--border-subtle);
      box-shadow: var(--shadow-subtle);
    }

    .bento-box.hero {
      grid-column: span 2;
      background: linear-gradient(135deg, #2b2730 0%, #3e3646 100%);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 10px 24px rgba(43, 39, 48, 0.22);
    }

    .bento-num {
      font-size: 22px;
      font-weight: 800;
      letter-spacing: -0.4px;
      margin: 4px 0;
    }

    /* STEPPERS FOR PRICE */
    .stepper-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-step {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      border: 1px solid var(--border-subtle);
      background: var(--bg-surface);
      color: var(--text-main);
      font-weight: 800;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* PHOTO BOX */
    .photo-box {
      border: 2px dashed var(--accent-pink);
      background: var(--accent-pink-soft);
      border-radius: var(--radius-lg);
      padding: 22px 14px;
      text-align: center;
      cursor: pointer;
      position: relative;
    }

    .photo-box.has-image {
      padding: 0;
      border: none;
      height: 190px;
      overflow: hidden;
    }

    .photo-box img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: var(--radius-lg);
    }

    /* FIXED FOOTER NAVIGATION */
    .footer-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      display: flex;
      justify-content: center;
      background: var(--bg-surface-elevated);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 1px solid var(--border-subtle);
      padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
      z-index: 999;
    }

    .footer-nav-inner {
      width: 100%;
      max-width: 440px;
      display: flex;
      justify-content: space-around;
    }

    .nav-tab-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px 6px;
      border-radius: var(--radius-md);
      transition: var(--transition);
    }

    .nav-tab-btn svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
    }

    .nav-tab-btn span {
      font-size: 10px;
      font-weight: 600;
    }

    .nav-tab-btn.active {
      color: var(--accent-pink);
    }

    /* VIEW SECTIONS */
    .view-section {
      display: none;
      flex-direction: column;
      gap: 14px;
      animation: fadeIn 0.22s ease-out;
    }

    .view-section.active {
      display: flex;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(5px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* MASTER CATALOG MANAGER STYLES */
    .catalog-item-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .catalog-item-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }
    .catalog-item-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
    }
    .catalog-item-controls {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 4px;
      font-size: 12px;
    }
    .badge-dur {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-base);
      padding: 4px 8px;
      border-radius: 6px;
      font-size: 11px;
      color: var(--text-secondary);
      border: 1px solid var(--border-subtle);
    }
    .ref-thumb-mini {
      width: 44px;
      height: 44px;
      border-radius: 8px;
      object-fit: cover;
      border: 1.5px solid var(--accent-pink);
    }

    /* MASTER WORK MANAGEMENT BUTTONS & MODAL */
    .master-work-actions {
      display: flex;
      gap: 6px;
      margin-top: 8px;
    }
    .btn-work-edit {
      flex: 1;
      padding: 7px 8px;
      font-size: 11px;
      font-weight: 700;
      border-radius: var(--radius-sm);
      background: var(--bg-base);
      border: 1px solid var(--border-subtle);
      color: var(--text-main);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: var(--transition);
    }
    .btn-work-edit:hover {
      border-color: var(--accent-pink);
      color: var(--accent-pink);
    }
    .btn-work-delete {
      padding: 7px 11px;
      font-size: 11px;
      font-weight: 700;
      border-radius: var(--radius-sm);
      background: var(--status-danger-soft);
      border: 1px solid rgba(248, 113, 113, 0.25);
      color: var(--status-danger);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }
    .btn-work-delete:hover {
      background: var(--status-danger);
      color: white;
    }

    /* MODAL OVERLAY & BOTTOM SHEET */
    .modal-overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(8px);
      display: flex;
      align-items: flex-end;
      justify-content: center;
      animation: fadeIn 0.2s ease;
    }
    @media (min-width: 768px) {
      .modal-overlay {
        align-items: center;
      }
      .modal-card {
        border-radius: var(--radius-lg) !important;
        max-width: 500px !important;
      }
    }
    .modal-card {
      width: 100%;
      max-width: 500px;
      background: var(--bg-surface);
      border-top-left-radius: var(--radius-lg);
      border-top-right-radius: var(--radius-lg);
      padding: 22px 20px max(env(safe-area-inset-bottom, 0px), 24px);
      box-shadow: var(--shadow-card);
      border: 1px solid var(--border-subtle);
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
    }
    .btn-modal-close {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: none;
      background: var(--bg-base);
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      transition: var(--transition);
    }
    .btn-modal-close:hover {
      background: var(--border-subtle);
      color: var(--text-main);
    }
    .modal-input, .modal-select {
      width: 100%;
      padding: 12px 14px;
      border-radius: var(--radius-sm);
      border: 1.5px solid var(--border-subtle);
      background: var(--bg-base);
      color: var(--text-main);
      font-size: 14px;
      font-weight: 500;
      outline: none;
      transition: var(--transition);
      margin-top: 6px;
    }
    .modal-input:focus, .modal-select:focus {
      border-color: var(--accent-pink);
      box-shadow: 0 0 0 3px var(--accent-pink-soft);
    }

/* === NATIVE iOS & MOBILE UX ENHANCEMENTS === */
html, body {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Tactile Spring Press Feedback */
button, .btn, .tab-btn, .slot-chip, .date-card, .service-card, .crm-tab-btn, .pill, .filter-chip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button:active, .btn:active, .tab-btn:active, .slot-chip:active, .date-card:active, .crm-tab-btn:active {
  transform: scale(0.96) !important;
}

/* Safe Area Inset Handling */
.bottom-nav {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

.modal-content, .modal-sheet {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease !important;
}

/* Liquid Glass Backdrop Saturation */
.glass-panel, .glass-card, .bottom-nav, .top-bar {
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
}
