* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    html,
    body {
      height: 100%;
      font-family: var(--md-font);
    }

    #container {
      display: flex;
      width: 100%;
      height: 100%;
    }

    #sidePanel {
      width: 380px;
      min-width: 380px;
      height: 100%;
      background: #fff;
      display: flex;
      flex-direction: column;
      box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
      z-index: 10;
    }

    .panel-header {
      padding: 20px 24px 12px;
      border-bottom: 1px solid var(--md-border);
    }

    .panel-header h2 {
      font-size: 20px;
      font-weight: 600;
      color: var(--md-text);
    }

    .panel-header p {
      font-size: 12px;
      color: var(--md-muted);
      margin-top: 4px;
    }

    .panel-body {
      flex: 1;
      overflow-y: auto;
      padding: 20px 24px;
    }

    .input-group {
      margin-bottom: 16px;
      position: relative;
    }

    .input-group label {
      display: flex;
      align-items: center;
      font-size: 13px;
      font-weight: 500;
      color: #555;
      margin-bottom: 6px;
    }

    .input-group label .dot {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      margin-right: 8px;
      flex-shrink: 0;
    }

    .dot-start {
      background: #52c41a;
    }

    .dot-end {
      background: #ff4d4f;
    }

    .dot-waypoint {
      background: var(--md-primary);
    }

    .input-wrapper {
      position: relative;
    }

    .input-group input {
      width: 100%;
      height: 40px;
      padding: 0 12px;
      border: 1px solid var(--md-border);
      border-radius: var(--md-radius);
      font-size: 14px;
      color: #333;
      outline: none;
      transition:
        border-color 0.2s,
        box-shadow 0.2s;
      background: #fafafa;
    }

    .input-group input:focus {
      border-color: var(--md-primary);
      box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
      background: #fff;
    }

    .input-group input::placeholder {
      color: #bbb;
    }

    .suggestion-list {
      position: absolute;
      top: 42px;
      left: 0;
      right: 0;
      z-index: 100;
      background: #fff;
      border: 1px solid var(--md-border);
      border-radius: var(--md-radius);
      box-shadow: var(--md-shadow);
      max-height: 200px;
      overflow-y: auto;
      display: none;
    }

    .suggestion-list.active {
      display: block;
    }

    .suggestion-item {
      padding: 10px 14px;
      cursor: pointer;
      font-size: 13px;
      color: #333;
      border-bottom: 1px solid #f5f5f5;
      display: flex;
      flex-direction: column;
    }

    .suggestion-item:last-child {
      border-bottom: none;
    }

    .suggestion-item:hover,
    .suggestion-item.active-item {
      background: #f0f6ff;
    }

    .suggestion-item .title {
      font-weight: 500;
    }

    .suggestion-item .addr {
      font-size: 11px;
      color: var(--md-muted);
      margin-top: 2px;
    }

    #waypointsContainer {
      margin-bottom: 16px;
    }

    .waypoint-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 8px;
    }

    .waypoint-row .input-group {
      flex: 1;
      margin-bottom: 0;
    }

    .btn-icon {
      width: 32px;
      height: 32px;
      border: none;
      border-radius: var(--md-radius-sm);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      transition: all 0.2s;
      flex-shrink: 0;
    }

    .btn-remove {
      background: #fff2f0;
      color: #ff4d4f;
    }

    .btn-remove:hover {
      background: #ff4d4f;
      color: #fff;
    }

    .btn-add-waypoint {
      width: 100%;
      height: 36px;
      border: 1px dashed #d0d0d0;
      border-radius: var(--md-radius);
      background: transparent;
      color: var(--md-primary);
      font-size: 13px;
      cursor: pointer;
      margin-bottom: 20px;
      transition: all 0.2s;
    }

    .btn-add-waypoint:hover {
      border-color: var(--md-primary);
      background: #f0f6ff;
    }

    .btn-plan {
      width: 100%;
      height: 44px;
      border: none;
      border-radius: var(--md-radius);
      background: linear-gradient(135deg, var(--md-primary), var(--md-primary-hover));
      color: #fff;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      letter-spacing: 1px;
    }

    .btn-plan:hover {
      background: linear-gradient(135deg, var(--md-primary-hover), #69b1ff);
      box-shadow: 0 4px 12px rgba(22, 119, 255, 0.35);
    }

    .btn-plan:disabled {
      background: #d0d0d0;
      cursor: not-allowed;
      box-shadow: none;
    }

    .btn-plan.loading {
      pointer-events: none;
      opacity: 0.8;
    }

    #routeInfo {
      margin-top: 20px;
      padding: 16px;
      background: #f9fafb;
      border-radius: var(--md-radius);
      display: none;
      border: 1px solid #f0f0f0;
    }

    #routeInfo.active {
      display: block;
    }

    .route-info-title {
      font-size: 13px;
      font-weight: 600;
      color: #333;
      margin-bottom: 12px;
    }

    .route-stat {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
      font-size: 13px;
    }

    .route-stat .label {
      color: var(--md-muted);
    }

    .route-stat .value {
      color: #333;
      font-weight: 500;
    }

    .no-route {
      color: var(--md-muted);
      font-size: 13px;
      text-align: center;
      padding: 10px 0;
    }

    #stepsContainer {
      margin-top: 16px;
      display: none;
    }

    #stepsContainer.active {
      display: block;
    }

    .steps-title {
      font-size: 13px;
      font-weight: 600;
      color: #333;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .steps-count {
      font-size: 11px;
      color: var(--md-muted);
      font-weight: 400;
    }

    .step-list {
      border: 1px solid #f0f0f0;
      border-radius: var(--md-radius);
    }

    .step-item {
      display: flex;
      align-items: flex-start;
      padding: 10px 12px;
      border-bottom: 1px solid #f5f5f5;
      cursor: pointer;
      transition: background 0.15s;
      position: relative;
    }

    .step-item:last-child {
      border-bottom: none;
    }

    .step-item:hover {
      background: #f0f6ff;
    }

    .step-item .step-icon {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: #f0f5ff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      margin-right: 10px;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .step-item .step-body {
      flex: 1;
      min-width: 0;
    }

    .step-item .step-text {
      font-size: 13px;
      color: #333;
      line-height: 1.5;
    }

    .step-item .step-meta {
      font-size: 11px;
      color: var(--md-muted);
      margin-top: 3px;
      display: flex;
      gap: 12px;
    }

    .step-item .step-distance {
      color: var(--md-primary);
      font-weight: 500;
    }

    .step-item .step-road {
      color: var(--md-muted);
    }

    #mapContainer {
      flex: 1;
      height: 100%;
      position: relative;
    }

    .swap-btn {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 28px;
      height: 28px;
      border: 1px solid var(--md-border);
      border-radius: var(--md-radius-sm);
      background: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      color: var(--md-muted);
      transition: all 0.2s;
      z-index: 1;
    }

    .swap-btn:hover {
      border-color: var(--md-primary);
      color: var(--md-primary);
    }

    .swap-wrapper {
      position: relative;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .spinner {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid #fff;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
      margin-right: 6px;
      vertical-align: middle;
    }

    @media (max-width: 768px) {
      #container {
        flex-direction: column;
      }

      #sidePanel {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 55%;
      }
    }
